In this tutorial we will be pivoting from our last tutorial on Graphical Elements to start focusing on databases in Android development. The android platform uses SQLite databases in its applications and is one of five data storage options in android development. We will only be focusing on SQLite development in android because it is key to the construction of a workable/functional program. After this tutorial you should be able to implement a SQLite database that you are then able to insert and select items from tables in the database.
For this project we will be creating a Random Quote generator that has you enter quotes or sayings in a textbox and press a button to insert them into the database. We will issue a confirmation toast that allows us to see if the data was entered into the database successfully and the textbox will be blank. If a second button is pressed, the database will be accessed and told to select a random quote from the database to show in a toast on the screen.
In this tutorial, we will be continuing from where we left off with the “hello world” application. This time adding a graphical user interface (GUI) and a “toast”. The GUI will consist of a button, textbox and a label. The “toast” will be issued onto the screen when the button is pressed.
Some may wonder what a toast is. Well, for non-programmers, a toast is a text notification that for the most part is used only to display an error on the screen (I am a big fan of using toasts instead of an alert on the screen as its less intrusive). For this article we will use a toast to display a message on the screen that will take the text in the textbox and issue a “Hello Greg” onto the bottom of the screen. After this article completed you will be able to successfully make toast commands, design the layout of the hello world program, and pull text from a textbox.
This article will focus on developing a simple hello world program for android using Java. Google has recently released a “cute and fuzzy” programming environment for beginners to get into but I haven’t had the chance to try it, so we will be focusing on the Eclipse IDE here, which you should have set up in the last post. When creating a text based project there are two very important items. It will involve creating an android project, going through the necessary steps to complete both the (1) XML files and the (2) Java file and get this project ready for production and eventually deployment. The requirements of this project are simple, know the basis of XML (for new comers if you don’t that’s OK too, you will learn) and know Java (very basic knowledge but you will learn as we go and we will modify a few parts of the java file today).
Android is the prime OS for developing applications in today for many reasons. The main reasons being that it is Open Source and Intuitive. In addition it uses Java for development, which is quite an easy language to get used to and develop in. This being said, a lot of you have great ideas for Android applications or applications in general but don’t know where to start. This series will take you behind the scenes and introduce you to the software that will be your best friend while developing for android. On this journey we will start with a “Hello World” and move on from there to create a database driven application with a touch and scroll interface. The final result will look something like this:
It seems a bit late to the party, but Microchip has just announced a family of PIC development boards for Apple products. The three offerings include a digital audio development kit, 8-bit accessory development and charging kit, and a 16-bit accessory development and charging kit for iPhone or iPod.
We’ve seen a lot of homebrew Apple addons that use microcontrollers. This not only takes the hardware interface to the next level, it does it with Apple’s blessing. But somehow that doesn’t seem like quite as much fun.
How would you like to have a 3-axis accelerometer, pressure sensor, temperature sensor, RF wireless, and an LCD screen in a development package? What if we told you that you can have it in the form factor of a wristwatch offering from Texas Instruments? How much would you pay for such a device? Quit guessing, you can pick it up for just $49 with an estimated delivery in mid-February of next year.
Our tip-line has been packed with emails about this since it was announced on Monday. The device ships with the firmware to serve as a sports watch with heart rate monitor. The price is pretty good just for that functionality but this package also includes a USB programming and emulation dongle so that you can develop your own firmware. It looks like the included development software is written for Windows but we’re hoping you can get it running on other platforms as well.
The LCD is a segment display, so you won’t see DOOM running on board. That said, we expect your first project to turn this into a wireless controller using the buttons and accelerometer.