About

Showing posts with label galaxy. Show all posts
Showing posts with label galaxy. Show all posts

10/27/12

Android Mega ADK test and design work concept

Here's some stills from booting up the CM9 modded S2 with an DFrobot Android Mega ADK (2560)

Haven't tested it yet, just installed the driver so far.
It appears to work and blinks green on boot and reset.

Rooted Galaxy S2

DFrobot 2A dual motor controller

Cyanogen 9/4.0.4 S2 with a 2GB SDcard

Robot top plate mounted on Rover 5 on some stand+offs

The shape of things to come....

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/9/12

Rooting and modding Samsung Galaxy S2

If you just have to mess with your phone all the time and try out every option and setting, you'll probably have heard about replacing stock software with custom kernels and flashing in mods. This could expand battery life, give you new features and make your phone faster.

It can also render your latest phone investment as useful as a brick. Yeah, brick. That's what they call it when either you or some software you tried to run makes your phone shut down for good and it will never boot up again. So be warned, even though I am about to tell you how to possibly avoid it.

I DO NO TAKE RESPONSIBILITY FOR YOUR ACTIONS! YOUR PHONE IS YOUR OWN AND ANY OF THIS WILL VOID YOUR WARRANTY!

And don't try to be clever, the phone will tell your technician that you installed a custom binary. This feature is called the 'ROM counter'.


  • First of all, some phones are known to have a bad FLASH chip, and this includes most versions of the Samsung Galaxy S2, from what I can read. 
  • Personally I have the GT-I9100 which came with GingerBread 2.3.5. 
  • If you, like me, have Samsung Kies installed (if not, do that NOW) and updated the firmware, you will discover that GingerBread 2.3.5 will be updated to Ice Cream Sandwich 4.0.4.


At this point, download the following:


  • Siyah kernel - Will give you a temporary rooted phone. Get the correct version, and put it on your SD card.  (you do need an SD card)
  • ClockWorkRecoveryMod (aka CWM)


There is a particular problem that seems to come with the stock ICS 4.0.4 when you install the 'clockworkrecovery' mod. Therefore, first of all you need to root your phone to be able to actually check your phone. (with Siyah)



You also want the Google Apps extras


  1. At this point, you have to boot up into recovery mode, and wipe the phone and the cache. 
  2. Then, load this binary into the phone. 
  3. When it reboots, it will show you a yellow triangle below the Galaxy logo at bootup, and if you go to Settings->About Phone you will see that the kernel has been replaced. 
  4. If you forget to wipe the cache as well, the phone will not boot. (It is not bricked, just repeat the process.)


Then download an app called eMMC checker from the Play Store. Move CM and Google Apps over to the SDcard.


  1. Download eMMC Brickbug Check from Play Store
  2. Run check. It will probably say 'Insane chip: Yes' and then you must check the memory, for which you need to have the phone already rooted.
  3. If the memory check passes, your phone's flash chip is functioning well enough to flash the ROM, but it will still kill it of you skip to the CWM step now!


Note: Just to be clear, both the memory needs to be OK and the Siyah kernel must be installed or else you will have a dead phone before this tutorial is over.


  1. Boot phone into Recovery Mode. (Home + Vol Up + Power.
  2. Hold until logo appears, release keys.
  3. You will be presented with the recovery menu. Some phones has alternate combinations.

Lastly:


  1. Wipe and factory reset
  2. Wipe cache
  3. Install CM from SDcard
  4. Install Apps from SDcard
  5. Reboot phone


Now, when you reboot, the phone will be a completely different beast. Modded or not, the S2 and S3 are  formidable devices, featuring multi-core CPU and GPU processing, as well as standardized USB connectors, an array of special-purpose sensor chips and last, but not least, a Linux-based operating system to glue it all together. With the right add-ons installed, your phone is essentially a powerful hand-held computer that can be used for a multitude of uses. While the comparison  is not fair, I would guess an S2 outperforms 5 year old laptops.

I think this was everything. Please comment if I missed something.

Anyway, here's the result: