Saturday, October 9, 2010

droid

Here is a potential work around. It uses the command line to add an
http proxy.

Note: you may need to update the escaping to use for windows.

cd to the location of adb
replace the pieces [host_or_IP] and [port] with the correct values for
the proxy. So if your proxy is corp_proxy, on port 8080, then in the
quotes should be corp_proxy:8080
----
./adb shell sqlite3 /data/data/com.google.android.providers.settings/
databases/settings.db "\"INSERT INTO system
VALUES(99,'http_proxy',' [host_or_IP]:[port]');\""
----

To see if it was added correctly you can run the following command
line. You should see 99|http_proxy| [host_or_IP]:[port]
----
./adb shell sqlite3 /data/data/com.google.android.providers.settings/
databases/settings.db "\"SELECT * FROM system\""
----

To remove the proxy, the following script can be run:
---
./adb shell sqlite3 /data/data/com.google.android.providers.settings/
databases/settings.db "\"DELETE FROM system WHERE _id=99\""
---

1. install Java SE and configure envirornment variables
get the Java SE from here: http://java.sun.com/javase/downloads/index.jsp
then you will get a bin file named with "jdk-6u17-linux-i586.bin"
open a shell terminate input command as below:
$ cd /opt/src : tranfer into the directory where store the jdk bin file
$ sudo chmod u+x jdk-6u17-linux-i586.bin : edit the bin's property to make it can be executed
$ ./jdk-6u17-linux-i586.bin : install jdk
mv the jdk directory to where you want to store your own program, here I move it to the /opt/android/, then it will be followed to configure the enviornment variables in shell configuration file. Go to /etc find profile add following sentences in it
"
#Java SE JDK
export JAVA_HOME=/opt/android/jdk1.6.0_17
export CLASSPATH=$CLASSPATH:.$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
"
store and quit
till now the jdk has been successfully installed, you may input following command in the shell to vertify it,
$ java -version
the shell will display some jdk information like this:
"
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6.1) (6b16-1.6.1-3ubuntu1)
OpenJDK Server VM (build 14.0-b16, mixed mode)
"

2. Downloadable SDK Components
website: http://developer.android.com/sdk/index.html
choose the Linux (i386) collumn's Package: android-sdk_r04-linux_86.tgz2.
then you will get a tar file : android-sdk_r04-linux_86.tgz, release it with following command:
$ sudo tar xfvz android-sdk_r04-linux_86.tgz
go into the "android-sdk-linux_86"
$ cd android-sdk-linux_86/tools
$ ./android
use the above command to start Android SDK and AVD Manager, select the Available Packages to install the android sdk you want to install, here I selected all. If you have any trouble when connect the website, change to "Settings", in "Misc" group select "Force https://... sources to be fetched using http://", push the "Save and Apply" button, then close the "Android SDK and AVD Manager". Restart it using the same command in the shell,
$ ./android

when setting up the ADT plugin or when using the SDK tools.

Optionally, you may want to add the location of the SDK's primary tools directory to your system PATH. The primary tools/ directory is located at the root of the SDK folder. Adding tools to your path lets you run Android Debug Bridge (adb) and the other command line tools without needing to supply the full path to the tools directory.

* On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to the tools/ directory to it. If you don't see a line setting the path, you can add one:
export PATH=${PATH}:/tools

here I edit profile in /etc like this:
#Android environment variables
ANDROID_TOOLS=/opt/android/android-sdk-linux/tools
export PATH=$ANDROID_TOOLS:$PATH

input "adb" in a new shell to vertity whether the enviornment variables has affected.
when you get some adb information it means you have succeeded.
$ adb
"
Android Debug Bridge version 1.0.25 ...
"

3. Finally install the ADT plugin into the Eclipse

Install the ADT Plugin for Eclipse

Android offers a custom plugin for the Eclipse IDE, called Android Development Tools (ADT), that is designed to give you a powerful, integrated environment in which to build Android applications. It extends the capabilites of Eclipse to let you quickly set up new Android projects, create an application UI, add components based on the Android Framework API, debug your applications using the Android SDK tools, and even export signed (or unsigned) APKs in order to distribute your application.

make sure that you have a suitable version of Eclipse installed on your computer (3.4 or newer is recommended). If you need to install Eclipse, you can download it from this location:

http://www.eclipse.org/downloads/

here I choose Eclipse 3.5 (Galileo) for example:
# Start Eclipse, then select Help > Install New Softare.
# In the Available Software dialog, click Add...
# In the Add Site dialog that appears, enter a name for the remote site (for example, "Android Plugin") in the "Name" field.

In the "Location" field, enter this URL: https://dl-ssl.google.com/android/eclipse/

If you have trouble aqcuiring the plugin, you can try using "http" in the URL, instead of "https" (https is preferred for security reasons). Click OK.
# Back in the Available Software view, you should now see "Developer Tools" added to the list. Select the checkbox next to Developer Tools, which will automatically select the nested tools Android DDMS and Android Development Tools. Click Next.
# In the resulting Install Details dialog, the Android DDMS and Android Development Tools features are listed. Click Next to read and accept the license agreement and install any dependencies, then click Finish.
# Restart Eclipse.

Now modify your Eclipse preferences to point to the Android SDK directory:

# Select Window > Preferences... to open the Preferences panel
# Select Android from the left panel
# For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory
# Click Apply, then OK.

Done! If you haven't encountered any problems, then you're ready to begin developing Android applications.

Troubleshooting ADT Installation

If you are having trouble downloading the ADT plugin after following the steps above, here are some suggestions:

If Eclipse can not find the remote update site containing the ADT plugin, try changing the remote site URL to use http, rather than https. That is, set the Location for the remote site to: http://dl-ssl.google.com/android/eclipse/
If you are behind a firewall (such as a corporate firewall), make sure that you have properly configured your proxy settings in Eclipse. In Eclipse 3.3/3.4, you can configure proxy information from the main Eclipse menu in Window (on Mac OS X, Eclipse) > Preferences > General > Network Connections.

If you are still unable to use Eclipse to download the ADT plugin as a remote update site, you can download the ADT zip file to your local machine and manually install it:

1. Download the current ADT Plugin zip file from here: http://dl.google.com/android/ADT-0.9.5.zip (don't unpack it)
2. Follow steps 1 and 2 of "here I choose Eclipse 3.5 (Galileo) for example:" (above)
3. In the Add Site dialog, click Archive.
4. Browse and select the downloaded zip file.
5. In Eclipse 3.5 only, enter a name for the local update site (e.g., "Android Plugin") in the "Name" field.
6. Click OK.
7. Follow the remaining procedures as listed for "here I choose Eclipse 3.5 (Galileo) for example:" (above)

If you still cannot install ADT plugin and encounter the error message like this:
"
Cannot complete the install because one or more required items could
> not be found.
> Software
being installed: Android Development Tools
> 0.9.5.v200911191123-20404 (com.android.ide.eclipse.adt.feature.group
> 0.9.5.v200911191123-20404)
> Missing requirement: Android Development Tools
> 0.9.5.v200911191123-20404 (com.android.ide.eclipse.adt.feature.group
> 0.9.5.v200911191123-20404) requires 'org.eclipse.wst.xml.ui 0.0.0' but
> it could not be found
"
there may be miss some plugins in your eclipse
1. Go to "Help/Install New Software...
2. Add http://download.eclipse.org/releases/galileo/ to the update sites list(strange it's not installed by default on ubuntu)
3. From there, install WST (use the filter box to find the package)
4. Restart eclipse
5. Go back to "Help/Install New Software..." and install the Android ADT as explained on the android website.

OK, till here you may have a breath, an Android SDK with Eclipse IDE has been successfully installed in you Ubuntu system.

Congratulation!!!

Summarized by Benjamin Qi
Intern of Beijing PalmCity Science and Technology Co., Ltd
MSN: benjaminqi@hotmail.com

In this tutorial we are going to learn how to install any given Android application in Android emulator using [dot]APK ".apk" files.

Follow the instructions with SCREENSHOTS of the Android emulator. All you need is just the Android SDK platform (software development kit, with emulator) and .apk files. There is no need to install Eclipse or Netbeans SDk, to work with APK files [wiki]. An .apk file extension denotes an Android Package (APK) file. This file format, a variant of the JAR format, is used for the distribution and installation of bundled components onto the Android mobile device platform.

Let's proceed with installation. First of all download the required stuffs.

1.Android SDK: It can be downloaded from the official google website- here is a link to Latest Android SDK (for which you also need JAVA VM, JDK or JRE already installed). Read how to install it, before you proceed with this tutorial. Don't forget to update the SDK and also install the suitable platform version, in this tutorial we are going to use a stable Android Platform 1.5.

2.Sample APK file: Let's take Sudoku.apk, please download it.

Android Logo"Are you ready for installation?"

WINDOWS XP/VISTA/SEVEN System Setting

Kindly NOTE : For this tutorial, the SDK has been unzipped to this Windows folder location: "E:\android-sdk-windows\"

Start the emulator (Virtual Android):

Android SDK manger window

Either you can start the emulator directly by running emulator.exe from "E:\android-sdk-windows\tools\"

OR

Run the setup sdk "SDK Setup.exe" from "E:\android-sdk-windows\" and then create and start AVD (emulator), in the above picture you can see that we have already created bOtskOOl AVD using Android SDK and AVD manager.

After a few minutes a virtual Android shall boot up and then observe the desktop view, as shown in the picture. Press on menu button and you will find that the applications are arranged in a grid view.

emulator android startingandroid emulator logoandroid desktop viewApplication grid view android emulator

Copy .APK files:

Now, manually copy and paste the Sudoku.apk to destination folder "E:\android-sdk-windows\tools\".

Run the windows command:

Go to Start>>run>>cmd (open a windows command prompt or shell) and type the following commands "highlighted in bold orange".

cd e:\android-sdk-windows\tools\

comments: we do this in order to change our directory level to where the emulator is installed

windows command line

adb install Sudoku.apk

comments: android emulator command to install the Sudoku application in .apk format.

Thats all, it's done. You must get a success message, Hurray!! You have installed your application successfully.

In case if you get error message then please do read the tutorial again, see to it that you have copied the apk file in the right folder or there is no uppercase/lower case error while typing file name.Now switch to your Android emulator, and click on the menu button, you will observe that a Sudoku application appears in the grid view.

application installed

Hope you will be able to install your favourite Android apps easily.

If you want to uninstall any application, then please do read this tutorial on how to uninstall Android .apk files from emulator.

"On other websites, people talk about Environment variables, but in this tutorial installation it has been achieved without doing so and it works superbly."

6 comments:

  1. Install Android SDK thru Proxy with Authentication

    Today I was trying to download and install additional SDK R5 components from Internet using the Android SDK and AVD Manager tool. Initially, the download was continuously failed, because, my system is behind a Proxy, which need an authentication. Android SDK and AVD Manager does not provide any option in the proxy settings, to include the proxy authentication (user name and password) details.

    So I decided to run my own proxy server locally and configure it to talk to the parent (original) proxy server with authentication detail. Initially, I decided NOT to run the heavy weight proxy Squid and selected TinyProxy for this purpose. But TinyProxy not supported the Authentication feature. So finally ended up running Squid proxy with following configurations:

    # Listen only local interface
    http_port 127.0.0.1:3128

    # Parent proxy (192.168.1.253:8080) and Authentication settings
    cache_peer 192.168.1.253 parent 8080 0 no-query default login=User:Passwd

    # No direct access
    never_direct allow all

    After restarting the Squid, I changed the proxy settings of Android SDK and AVD Manager to:

    Proxy: 127.0.0.1
    Port: 3128

    After this, restarted it. Now the additional components are successfully downloaded.

    ReplyDelete
  2. http://www.talkandroid.com/android-sdk-install-guide/

    http://developer.android.com/sdk/installing.html

    ReplyDelete
  3. http://androidapps.org.ua/toc.html

    ReplyDelete
  4. working with http-proxy http://forum.xda-developers.com/showthread.php?t=766569

    ReplyDelete
  5. ## droid hello world
    http://developer.android.com/guide/tutorials/hello-world.html

    ReplyDelete
  6. In this tutorial we are going to learn how to install any given Android application in Android emulator using [dot]APK ".apk" files.

    Follow the instructions with SCREENSHOTS of the Android emulator. All you need is just the Android SDK platform (software development kit, with emulator) and .apk files. There is no need to install Eclipse or Netbeans SDk, to work with APK files [wiki]. An .apk file extension denotes an Android Package (APK) file. This file format, a variant of the JAR format, is used for the distribution and installation of bundled components onto the Android mobile device platform.

    Let's proceed with installation. First of all download the required stuffs.

    1.Android SDK: It can be downloaded from the official google website- here is a link to Latest Android SDK (for which you also need JAVA VM, JDK or JRE already installed). Read how to install it, before you proceed with this tutorial. Don't forget to update the SDK and also install the suitable platform version, in this tutorial we are going to use a stable Android Platform 1.5.

    2.Sample APK file: Let's take Sudoku.apk, please download it.

    Android Logo"Are you ready for installation?"

    WINDOWS XP/VISTA/SEVEN System Setting

    Kindly NOTE : For this tutorial, the SDK has been unzipped to this Windows folder location: "E:\android-sdk-windows\"

    Start the emulator (Virtual Android):

    Android SDK manger window

    Either you can start the emulator directly by running emulator.exe from "E:\android-sdk-windows\tools\"

    OR

    Run the setup sdk "SDK Setup.exe" from "E:\android-sdk-windows\" and then create and start AVD (emulator), in the above picture you can see that we have already created bOtskOOl AVD using Android SDK and AVD manager.

    After a few minutes a virtual Android shall boot up and then observe the desktop view, as shown in the picture. Press on menu button and you will find that the applications are arranged in a grid view.

    emulator android startingandroid emulator logoandroid desktop viewApplication grid view android emulator

    Copy .APK files:

    Now, manually copy and paste the Sudoku.apk to destination folder "E:\android-sdk-windows\tools\".

    Run the windows command:

    Go to Start>>run>>cmd (open a windows command prompt or shell) and type the following commands "highlighted in bold orange".

    cd e:\android-sdk-windows\tools\

    comments: we do this in order to change our directory level to where the emulator is installed

    windows command line

    adb install Sudoku.apk

    comments: android emulator command to install the Sudoku application in .apk format.

    Thats all, it's done. You must get a success message, Hurray!! You have installed your application successfully.

    In case if you get error message then please do read the tutorial again, see to it that you have copied the apk file in the right folder or there is no uppercase/lower case error while typing file name.Now switch to your Android emulator, and click on the menu button, you will observe that a Sudoku application appears in the grid view.

    application installed

    Hope you will be able to install your favourite Android apps easily.

    If you want to uninstall any application, then please do read this tutorial on how to uninstall Android .apk files from emulator.

    "On other websites, people talk about Environment variables, but in this tutorial installation it has been achieved without doing so and it works superbly."

    ReplyDelete