dimanche 12 décembre 2010

Some tips for newbies developers on Android 2.2 (like me)

The tips are :
  • Know the devices which are connected
  • Deploy your application on real devices
  • Deploy your application on SD Card
  • Know the location (internal or SD Card) of your application and move it or stop it
Know the devices which are connected
  • On your computer, open the terminal (command prompt on windows) and launch the command:
    android-sdk/tools/adb devices
Deploy your application on real devices
  • Stop your Android emulator

  • Connect your Android device to your computer with an USB cable
    (on Windows, may be you should install USB driver for adb. Me, I use a Mac ;) )

  • On your Android device, enable USB debugging
    Settings>Applications>Development>USB debugging

  • On your computer, open the terminal (command prompt on windows) and launch the command:
    android-sdk/tools/adb install path/file.apk

    Where path is the path of your application packaged in APK and file is the name of your APK file.
  • Your application is installed!
Deploy your application on SD Card
    The procedure to deploy your application on SD Card, instead of Internal memory, is pretty similar to the procedure above.
    You have just to :
      • add the android:installLocation attribute with the value auto in the AndroidManifest.xml file.
        <manifest xmlns:android="http://schemas.android.com/apk/res/android"
         
        android:installLocation="auto"
        ...

        For more informations on this attribute, read : App Install Location
      • deploy your application with the command:
        adb install -s
        path/file.apk
Know the location (internal or SD Card) of your application and move it or stop it
    Knowing the location of an application is very easy on Android 2.2.
    On your Android device go to: Manage applications
    Settings>Applications>Manage applications
    And if you select an application, you can move this application (if it's possible) to the SD Card or to the internal memory of your device.
    You can even force stop of this application   

Aucun commentaire: