About

Showing posts with label android. Show all posts
Showing posts with label android. Show all posts

10/26/12

Setting up an Android development environment

Books to read

Apress, Beginning Android 4 (2012) - Comes with source code available here
Although it says it's for Android 4.0, the book uses 2.2 but also tells the reader how to adapt to frameworks you don't actually develop for. Very clear and informational, and had me writing code in just a few minutes.

Addison-Wesley, The Android Developers Cookbook (2011)
Has the same clear style as the above one, with simple XML snippets and the code to support just that. I don't like tech books that wants you to build a huge application, when all you needed was an explanation for how to use a certain GUI element on page 76.

Software to get

Decide if you want Eclipse SDK 3.8 or 4.2. The 4.x series will eventually be better, but 4.3 won't be out until June 2013. 4.2 has a new internal UI engine. Meanwhile, the 3.x series is more than sufficient and also very fast. I also  keep my OS on an SSD drive, and my development stuff on a RAID0 disk. That does help when you are dealing with large Java environments. 



Setting up the environment

Download Android SDK here. This is the toolkit needed to link Eclipse to you Android phone, or to start up an emulator. You can set most Androids up to push debug messages trough the USB. These messages will appear in the debug console in Eclipse. This is generally not needed during normal app development. If you look trough the log you will see hundreds of notices about battery state, memory and the likes.


From the SDK Manger, you can download the API's and tools you want to target for. Some of the API's for the more esoteric phones require that you have a login at their respective manufacturers development network. You can safely cancel the ones you cannot download.


In the AVD (Android Virtual Device) Manager, you set up virtual machines that emulate the platform you want to develop for.

You create the project in File->New->Other->Android Application Project.


Now, all you have to do is to make a Run-configuration for your Android project. 


If you got this far, you should pretty much be able to run a skeleton application on your own USB connected phone 

Hardware and specs

I use a Samsung Galaxy Xcover GTS5690 for development. That is pretty much an S2 stripped of a CPU core and has less memory and smaller screen (a 'medium' class screen in phone terms, 320x480 or 480x320 rotated). Some programs even identify it as an S2. This phone has 512MB RAM, single core Marvell ARMv7 @ 800Mhz and a Marvell GLES2.0 chip as well as some yet unknown hardware for video playback of some formats. I have a 8GB SDcard stuck in it as well. 

While not high end, a quick survey among friends suggest the 2.x series Androids will be around for a long time. Samsung is even still making BIOS updates to this phone as this were written, and a mid-end dev system could be a good exercise in resourse management. Many people out there has low-end older phones as well as mid-end ones.

Flexibility across devices

Android was written with the fact in mind that devices will be different, so it has built in flexibility to handle this. Some things can be done even better with minor effort from the developer, such as simply targeting for a higher level API will enable functionality for adapting to 4.x enhances features.

Targeting a 2.2 device would cover 93% of the market. It seems the 1.x series is pretty much obsolete. Also, the changes from the 2.x to the 3.x and 4.x series seems to be smaller compared to the leap that was from 1.x to 2.x. Not having developed on 1.x, I cannot say for sure, but telling from the literature, most of the features people were missing in 1.x got generously implemented in 2.x. 

Messing up is easy

It's really easy to mess up an Android project, so keep your CVS up and running.

10/10/12

Arduino robot project

10/10/12


With the helpful guys at Robonor.no, I've ordered the following parts for my project:
Arrived in the mail today, UNO R3 from Robonor

Dagu 4 motor controller is on it's way from England!

I will eventually get the Rover5 4-engined robot, but as the Dagu controller card is hard to get, I have to put this on hold for a while. At the moment, I will have enough to do by going trough the basics! When the Rover is in place, I will get an Mega ADK board for my Android phone to utilize all the sensors.



I have ordered the Dagu controller from the UK along with an IR compund eye from RoboSavvy. I'll slip right under the 20 pound tax limit! This could take a cool 2 months 4 weeks though. (Seems he could speed it up a bit!?

Meanwhile,I'll get to program the Arduino controller and hooking up the LCD display.
Fun times!
Serial Enabled 16x2 LCD - Black on Green 5V

11/10/12


Got an old laptop from a friend for fixing his new one and installing games and a 'safe' browsing environment. Not too bad either, Dual core AMD Turion with 2 gigs and 256 mb shared gfx memory. Will probably install XP in this to use all the easily available Arduino tools, and run Linux in a VM to run electronics software.

Postal service reports that the package has been received and will probably end up here tomorrow afternoon :)

13/10/12



Picked up package today, everything was included as far as I can tell, except the 3-pin serial LCD, but i actually got a much better LCD with a mounted backpack, so this should be a serious upgrade! Thanks Robonor! Quick delivery too!


Graphic LCD Serial Backpack


Serial Graphic LCD 128x64

First testing footage

From the Circ-02 tutorial with 8 leds

Well, cannot complain, everything worked as expected!

14/10/12



Some connectors was badly soldered from the factory. Fixed that and now it should work. Pixels was all over the screen.



Some error in the manual it seems. It won't work from the 5.5v line, have to use Vin. Here you can see the Sparkfun icon!

Some software I probably need:
http://www.atmel.com/tools/AVR32STUDIO2_6.aspx