Showing posts with label Android SDK. Show all posts
Showing posts with label Android SDK. Show all posts

Friday, 7 September 2012

Install Android Apps to SD Card (by Default)

By installing apps directly to SD card, we can overcome the problem of internal memory of devices (applicable for those apps which are not dedicated for internal space). But the question is 'how to set storage default to sd card' ? So here is the solution:


Pre-requisites:
1. Android SDK (Click here for SDK setup)
2. Setup of ‘adb’ (Click here for adb)



As we know, Android apps install to the internal storage by default, but we can also set the SD card as the default install location. This trick allows moving almost any app to the SD card(WITHOUT Root Access required).

This requires Android 2.2 or later. To change the default install location, you’ll need to use the ADB (Android Debug Bridge) and Android SDK.


Step 1: Enable USB Debugging-
First, we need to enable USB debugging on Android device. For this:

Open the Settings screen > tap Applications > select Development




Then, tap ‘USB Debugging’ checkbox to enable it. This will enable debug mode, allowing changing the settings on Android device from computer. We may want to disable debug mode after completing this process.





Step 2: Install the Android SDK-
All we need to download and install Android SDK on computer.
After installing the SDK, launch the SDK Manager from Start menu



The ADB utility isn’t installed by default. It’s included in the Android SDK ‘Platform-tools’ folder – select this package and click the Install button to download and install it.



After the process completes, connect Android device to computer with its included USB cable (or just connect the emulator). Windows should locate the device and install the appropriate drivers automatically. If it doesn’t, you may have to download and install the appropriate drivers from your Android device’s manufacturer. Do not mount the device after connecting it – just plug it in.


Step 3: Using ADB-
Open a Windows Explorer window and navigate to the ‘android-sdk\platform-tools folder

Note: platform-tools folder install with the package of SDK.

Path could be as : E:\android-sdk-windows\platform-tools


Launch a Command Prompt window in this folder by pressing and holding the Shift button, right-clicking in the folder, and selecting Open command window here.




Run the adb devices command, it will show the connected Android devices:




Run the following command to set the default install location to your SD card:

adb shell pm setInstallLocation 2


Note: If you want to revert this change later and install apps to the internal storage by default, run this command:

adb shell pm setInstallLocation 0

0 represents device’s internal storage, and is the default. 2 represent the external storage, whether it’s an SD card or USB storage.



Moving Apps to SD Card:
Apps that refused to leave your system storage can be moved to the external storage. For instance, below you’ll see screenshots of the Slacker Radio app. Before the change was made, the ‘Move to USB Storage’ button was grayed out (disabled). After the change was made, the button is enabled and the app can be moved.


To move an app to the SD card, open the Settings screen, tap Applications, and select Manage Applications. Select the app you want to move and tap the Move button on its details screen.

Tuesday, 24 July 2012

Eclipse configuration with Android SDK


Pre-requisites:
  1.  Eclipse setup
  2. Android SDK setup
  3. ADT Plug-in for Eclipse
  4. AJDT (for AspectJ conversion)

Eclipse:
Download Eclipse from URL:

Version: Eclipse Classic 3.7.2 (Windows 32 Bit)
No need to install the Eclipse, just unzip the downloaded folder anywhere in local drive. That will provide the ‘eclipse.exe’ which will open the Eclipse framework.

On opening the Eclipse framework, it will ask for the location of ‘workspace’ folder (‘Workspace’ is the location where the entire Eclipse project will be saved). Make any workspace folder anywhere in your machine and give the location.

Now Eclipse has successfully configured. Now we can open Eclipse, write any program and can save program to workspace folder.

 Android SDK setup:
We need to setup and configure Android with Eclipse. Basically it is for development process but in case if we need to check how’s the application behave we can have a look on such the application in eclipse.
Download Android-sdk-windows (android-sdk_r18-windows) from the following URL:

No need to install the Android, just unzip the downloaded folder (android-sdk_r18-windows) anywhere in local drive. That will provide the ‘SDK Manager.exe’ (which will open the Android SDK Manager) and ‘AVD Manager.exe’ (which will open the AVD Manager).

     i) SDK Manager: used for installing the Android packages
·         Run the ‘SDK Manager.exe’ (can be found in the ‘android-sdk-windows’ folder)
·         Android SDK manager will provide the list of package to install
·         Install any of the package (like Android 4.0.3 (API 15))


      ii) AVD Manager: used for creating the Virtual Device (emulator)
·         Run the ‘AVD Manager.exe’ (can be found in the ‘android-sdk-windows’ folder)
·         ‘Android Virtual Device Manager’ window will be open.
·         Click on New> and follow the steps as shown in below screenshot:




Name: name of Virtual device (or emulator)
Target: version of Android emulator which you are going to use
CPU/ABI: for Android, use ARM
SD Card ‘Size’: it could be 512MB or 1GB
Snapshot: checked (best practice) [It will keep the track if any activity killed or process crashed, if its enabled we can restore the session ]
Skin ‘Built-in’: HVGA (for Android)

Click on ‘CreateAVD’. It will create the AVD which will be seen in ‘Android Virtual Device Manager’ under ‘AVD Name’ section.
Select the AVD name and click on ‘Start’. ‘Launch Option’ pop-up will be open. Then click on ‘Launch’.  It will open the Android emulator.

ADT plug-in for Eclipse:
 ADT plug-in extends the capabilities of Eclipse to let you quickly set up new Android projects, build an app UI, debug your app, and export signed (or unsigned) app packages (APKs) for distribution.
To install ADT plug-in:
      ·         Start Eclipse> Help > Install New Software....
      ·         Click Add, in the top-right corner.
      ·         In the Add Repository dialog that appears, enter "ADT Plug-in" for the Name and the following URL for the Location:
      ·         https://dl-ssl.google.com/android/eclipse/
      ·         Click OK

Restart the Eclipse. It will ask for the Android SDK (which is we have already install as above mentioned steps) so Just give the location of Android SDK path.
Now while looking on the Eclipse, TWO newly added icons will be shown, these TWO icons are for ‘AVD Manager’ and ‘Android SDK Manager’.

Now Eclipse is configured with Android SDK.