Tuesday, November 30, 2010

Track Site's rating in the Android Market

I've rated my Track Site app at the « Teen » level according to the guidelines that have been supplied at Android Market Help Center http://market.android.com/support/bin/answer.py?answer=188189.

The specific rules that have made me rate my Track Site app « Teen » instead of « All » is the section
User Generated Content and User to User Communication

Apps rated “All” should not host any user generated content or enable communication between users. Apps that focus on allowing users to find and communicate with each other should be rated “Teen” or above.
and more specifically the first sentence :
Apps rated “All” should not host any user generated content or enable communication between users.

As Track Site allows users to enter a description on each bookmark and send their bookmarks by emails or by texting (SMS), I just can't rate it « All ».

Friday, November 12, 2010

Track Site : permissions that are asked for

Permissions have been reworked : Track Site doesn't ask anymore for READ_CONTACTS and SEND_SMS permissions.

Nevertheless it's still possible to send a bookmark by email or by text (SMS), as Track Site passes control to the stock communication apps (Gmail, Email, Messaging, ...) to do the job. Those stock communication apps already have been granted the required permissions (to read contacts and to send SMS /texting) by the user when they have been installed.


Permissions that Track Site previously asked of



Permissions that Track Site now asked for



Here is a screenshot of how permissions appears on the Android Market now

Thursday, November 11, 2010

obfuscation : how to use the obfuscation in the android app development cycle

This post deals with how the new obfuscation step modifies the app development cycle.

I use Eclipse to develop my app (Track Site). After some upgrade, when the app is ready to go live, I usually do the following tasks in order to publish it on the Android Market :
  1. adjust the version number
  2. export an unsigned version of the app from Eclipse
  3. sign it using the standard jarsigner tool
  4. align it using the standard zipalign tool

Obfuscation, as explained in Proguard, Android, and the Licensing Server, involves additional steps that replace the former 2) to 4) steps :
  1. adjust the version number the same way you've done it before
  2. obfuscation is performed using ant (not Eclipse) by issuing a command on the terminal

    mac:TrackSites $ ant release
    Buildfile: ~/workspace/TrackSites/build.xml

    As indicated in the Proguard, Android, and the Licensing Server post, the local.properties file has been modified to perform the signing step [3)] automatically (it still asks you for the passwords though), as well as the alignment one [4)].

    You end up with a signed, aligned and obfuscated app file in the bin/ sub-directory : the app is named SiteListActivity-release.apk. Exporting the unsigned app from Eclipse generates an app file named TrackSite.apk.

    It's interesting to note that the obfuscation process is done in another hierarchy (bin/classes) than the one used by Eclipse (bin/).

  3. as the obfuscation may have broken things, there is another quality assurance phase of the obfuscated app (SiteListActivity-release.apk), not of the non-obfuscated app that has already been tested from Eclipse (TrackSite.apk)

    This should be done :
    a) on the emulator :
    • start the emulator in the background with an AVD as a parameter
      mac:TrackSites $ emulator -avd a8w480 -wipe-data &
      [1] 536
      2010-11-11 10:14:15.172 emulator[491:903] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.


      The -wipe-data option in the command line allows to « Reset the current user-data disk image (that is, the file specified by -datadir and -data, or the default file). The emulator deletes all data from the user data image file, then copies the contents of the file at -inidata data to the image file before starting. ».

      Here is the emulator state when it is started without the -wipe-data option
      And it's state with the -wipe-data option

      The list of devices + emulators connected to the computer is obtained with
      mac:~ $ adb devices
      List of devices attached
      HTxxxxxxxxxx device <----- the real device emulator-5554 device <----- the emulator

    • install the obfuscated app (SiteListActivity-release.apk) on the emulator using adb command line tool
      mac:TrackSites $ cd bin
      mac:bin $ ls Site*
      SiteListActivity-release.apk SiteListActivity-unsigned.apk
      SiteListActivity-unaligned.apk SiteListActivity.ap_
      mac:bin $ adb -e install SiteListActivity-release.apk
      1340 KB/s (94595 bytes in 0.068s)
      pkg: /data/local/tmp/SiteListActivity-release.apk
      Success
      mac:bin $

      The -e option in the command line « direct an adb command to the only running emulator instance. ».

      The app is now installed in the emulator where it can be tested :

    b) on a real device : it's pretty much the same process as above but on a real device instead of an emulator.

    When installing the app on the device, you may encounter an error if a previous version of the app has been installed from the market :
    mac:bin $ adb -d install SiteListActivity-release.apk
    821 KB/s (94595 bytes in 0.112s)
    pkg: /data/local/tmp/SiteListActivity-release.apk
    Failure [INSTALL_FAILED_ALREADY_EXISTS]
    mac:bin $

    By the way, please take note of the -d option in the command line « direct an adb command to the only attached USB device. ».

    The solution here is to remove the app on the device : Menu -> Settings -> Applications -> Manage applications then select the application to uninstall, click on the "Uninstall" button, confim ... it works ! But there's a better solution using adb :
    mac:bin $ adb -d uninstall fr.androidtobe
    Success
    mac:bin $


    You can now try to install just like before :
    mac:bin $ adb -d install SiteListActivity-release.apk
    839 KB/s (94595 bytes in 0.110s)
    pkg: /data/local/tmp/SiteListActivity-release.apk
    Success
    mac:bin $

  4. Ensure everything works and that the obfuscation has not broke anything. Then publish the obfuscated app (SiteListActivity-release.apk).

    If something has been broken during the obfuscation step, look for clues in the « But Wait, My App is Crashing Now » part of the Proguard, Android, and the Licensing Server post

Tuesday, November 9, 2010

HTC Desire HD - the permanent root with [DEV] PERMROOT & eMMC write [INSTRUCTIONS]

A permanent root solution has been found for the HTC Desire HD. Detailled instruction are in the XDA-Developers post [DEV] PERMROOT & eMMC write [INSTRUCTIONS].

Nexus One : how to prepare for Gingerbread

The next release of Android, Gingerbread, is rumored to be OTA released in the coming days. Android Central, working with XDA-Developers wiki comes with a welcomed [How-to] Prep Nexus One for Gingerbread

« If you're like us, and have your Nexus One hacked nine ways to Sunday, you'll need to get ready if you don't feel like waiting for someone to rip it apart and whip up a version for the rooted and ROM'd crowd. »

Saturday, November 6, 2010

Nexus One - installing [ROM] Enomther's TheOfficial Nexus1 - v2.13.2 - 10/11/2010

I've decided to give a try to [ROM] Enomther's TheOfficial Nexus1 - v2.13.2 - 10/11/2010.

The Nexus state before installing Enomther's TheOfficial ROM :


Here are the detailled steps to install it on a rooted Nexus One.
  1. connect the Nexus to your computer using the USB cable
  2. download the resources and check the md5
  3. copy the files to the SD card.
    You can either mount your phone in USB storage mode (recommended) or use adb tool
    The files to be copied to the root of the SD card are :
    • RADIO TheOfficial_Nexus1_Radio_Update_4.06.00.12_7.zip
    • ROM : TheOfficial_Nexus1_v2.13.2_update.zip
    • MUSIC : origmusic_2.12.1.zip
    • CAM : origcam_2.12.3_kernel_audiomod.zip
    • TORCH : CMMod_Torch_2.11.3.apk.apk
    The RADIO TheOfficial_Nexus1_Radio_Update_4.06.00.12_7.zip will be flashed.
  4. make a Nand backup
    • Reboot the Nexus One in bootloader mode : hold down the trackball while you press the power button. Ensure to maintain the trackball hold down until the screens turns to a white screen with 3 green android skating at the bottom of the screen. Ensure that the Nexus One stay connected to the computer via the USB cable.
    • on the screen, the BOOTLOADER should be highlighted with blue. press power button
      on the new screen, scroll down with the Volume down button to highlight the RECOVERY option. Press the power button.
    • the Nexus One reboots and after a few seconds, the screen title with "Android system recovery" appears, with the "Build : RA-nexus-v1.7.0" at the bottom of the screen. The screen should be in cyan instead of green if the Nexus One has already been rooted
    • scroll down with the trackball to the "Backup/Restore" menu and press the trackball
    • on the new screen "Choose backup/restore item" choose the option "Nand Backup" (the first one) by scrolling down the trackball and press the trackball to select it. The question "Create Nandroid backup?" appears at the bottom of the screen, so press the trackball to confirm as it is stated
    • The backup starts, it takes a few seconds to complete. At the end of the backup, the cyan screen is restored. Press Volume down button to return to the previous screen "Android system recovery".
  5. flash the RADIO
    • back to the Android system recovery screen, scroll down to the Flash zip from sdcard item using the trackball. Press the trackball to select
    • on the new screen Choose update ZIP file, use the trackball to select the right ZIP file to flash. Start with the RADIO TheOfficial_Nexus1_Radio_Update_4.06.00.12_7.zip. then press the trackball to start the flashing. Press the trackball again to confirm flashing on the question "Install : TheOfficial_Nexus1_Radio_Update_4.06.00.12_7.zip ?" that appears at the bottom of the screen. The ROM flashing starts and many messages appears on the screen.
    • after some time, the message "Install from sdcard complete" appears and you're asked to reboot the phone to write the image on the phone. Press the trackball to proceed
    • after some time, you're back to the Android system recovery screen
  6. WIPE
    • from the Android system recovery screen, select the WIPE item using the trackball and press it
    • from the new screen "Choose wipe item", highlight the "wipe data/factory reset" item (the first one) and press the trackball once to select it, then press the trackball another time to confirm to proceed as it is asked at the bottom of the screen
    • then redo the same steps for the "Wipe cache", "Wipe Dalvik-cache", "Wipe battery stats", "Wipe rotate settings" but don't wipe the "SD:ext partition"
    • press VOL-DOWN to return to the Android system recovery screen
  7. flash the ROM
    • highlight the "Flash zip from sdcard" item using the trackball and press the trackball to select the item
    • from the "Choose update ZIP file" screen, highlight the "TheOfficial_Nexus1_v2.13.2_update.zip" item and press the trackball to select it. Press the trackball another time to confirm as you're asked to at the bottom of the screen. The flashing starts. At the end of the process, you're back to the Android system recovery screen.
    • follow the same steps to flash the MUSIC origmusic_2.12.1.zip
      and CAM origcam_2.12.3_kernel_audiomod.zip files. The nexus reboots automatically after fashing each of those files.

After flashing the Enomther's TheOfficial Nexus ROM :

Monday, November 1, 2010

Desire HD - rooting and shutdown, restart and fastboot modes

The Desire HD has 3 modes when it comes to shutdown and startup :
  • full shudown : it's the classical way of shutting down Android. All processes are killed and the caches are flushed. After a shutdown, there is a cold start which takes quite a lot of time : about 25s to get the htc logo with the djingle + 40s more to load Android and ask you to enter your PIN code + 25s more to register on the network.

    rooting : After a full shutdown, the temporary rooting needs to be done again, and any package that may have been disabled (see [GUIDE] Disabling Stock/System Apps) has to be disabled again.
  • restart (reboot) : it's also a classical way to restart Android that takes approximately the same time the full shutdown process takes.

    rooting : After a reboot, the temporary rooting needs to be done again, and any package that may have been disabled (see [GUIDE] Disabling Stock/System Apps) has to be disabled again, like after a full shutdown.
  • fastboot shutdown : this is a new shutdown mode introduced by HTC in its latests smartphones. It basicaly freeze everything (processes, cache, ...) in its state and then has just to unfreeze them to startup. The startup process is then very fast : less than 5s for the phone to ask you to enter your PIN code + 25s more to register on the network.

    rooting : After a fastboot shutdown, the temporary rooting that may exists before the fastboot still exists and does not need to be done again, and any package that may have been disabled (see [GUIDE] Disabling Stock/System Apps) is still disabled. By the way, any app that have been launched before the fastboot is still awake and available through a long press on the Home button.



The power-down screen look like :


The fastboot shudown mode has to be activated from the "Menu" -> "Settings" -> "Applications" -> "Fast boot" checkbox :


The restart option ask for a confirmation :