Portable Android Development - Android Software Development

Hello everyone
Have you ever been bored in a borrowed pc and wanting to try out a new library/idea on your android but dont have admin privileges to install all the needed android tools? I was in this exact same situation, so i decided to engineer a solution (After all, i AM an engineering student ) to this boring problem. This solution works almost entirely like a standard Android SDK install (Only downside: Eclipse won't run your application) and has only been tested on Ubuntu Linux so you are on your own on other platforms, but the principle is the same, it might work after all.
Whenever prompted for a platform choose x86 , x64 needs ia32-libs which you cant install due to not having admin privileges
1. Create a directory for all the files and folders (I'll name mine "Development")
2. Download the JDK tar.bz file from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1637583.html (You'd better search for an updated link when you read this tho) and extract it into Development
3. Download eclipse from http://eclipse.org/downloads/ (I used the Eclipse IDE for Java Developers) and extract it into the Development folder
4. Download the Android SDK from http://developer.android.com/sdk/index.html (If you are on windows, choose the zip!. Again, i've only tested on Linux so you are on your own) and extract it into the Development folder
5. Open the tools/android (It's a shell script) file with gedit/any other editor and edit the line containing java_cmd=".." to read java_cmd="/home/xxx/Development/jdk1.7.0_06/bin/java" (This is my case, make sure this line actually points to the place where you extracted the jdk zip, else this will fail)
6. Open a terminal, cd to the location where you extracted the android sdk, then type "./tools/android" and press enter (Without the quotation marks) to start the sdk manager, install the platform-tools package, the Jellybean (4.1) SDK, and any other SDK you may want, then close the SDK manager.
7. cd to the Development folder and run this "./eclipse/eclipse -vm jdk1.7.0_06/bin" (Assuming you kept the stock folder names from the zips) to run eclipse, then install the ADT as described here http://developer.android.com/sdk/installing/installing-adt.html.
8. When eclipse restarts, it will ask you for the android sdk, just point it to the location where you extracted it.
That's it, your eclipse installation is ready for you to write code.
Now, to debug you'll need to do so manually as eclipse won't somehow recognize this workaround to the usb priviliges (Linux won't allow adb to communicate with the phone unless it's ran as root [Which you can't, that's why you are here] or a configuration file [Again, written as root] is present) system so you need to do this to make adb work:
1. Disconnect your phone from 3G (Optional)
2. Connect your phone to your pc via usb
3. Enable usb tethering on your phone
4. Enable ADB over Network on Application settings
5. On the terminal emulator, run "ip addr show" and look for the usb section
6. On your computer, open a terminal and cd to the tools directory fo the android sdk, then type "./adb connect xxx.xxx.xxx.xxx" (Replace the x's with the IP of your phone, as it appears on the output of the previous command. Remember to use the one on the USB section)
7. Verify adb picked up your device by runing "./adb devices", if it lists an IP as a device, you are ready
Each time you want to test your app, export a signed apk from your project (I may write a small guide for that later, google will help you if you dont know how to do it) and run "./adb install xxx.apk" (Obviously, replace xxx with the path to your exported apk). The icon(s) for your main activity(ies) will promptly appear on your launcher. Again, Eclipse won't run nor debug your app using this method. (Maybe it's an SDK bug?)
I know it's not exactly streamlined but it's something for when you are on the go.
Hope you find this guide useful someday. Until next time.

Related

Install non-market apps without File Manager: Possible?

Simply put is there a way to get an app onto my phone without the market or file manager?
I ask because I want to use Haykuro's G build but I cant download any apps. I do however have all the ones I use regularly backed up onto my SD card but I cant access them without a File Manager (which I cant download to use). Is there a way?
|Spike|
There's always the option of using AppsInstaller/APKInstaller and putting APK's onto your SD Card. Though, to install AppsInstaller, you have to install it through ADB.
Unicornasaurus said:
There's always the option of using AppsInstaller/APKInstaller and putting APK's onto your SD Card. Though, to install AppsInstaller, you have to install it through ADB.
Click to expand...
Click to collapse
How do I install thru ADB?
|Spike|
Get the android usb drivers, adb.exe and adbwinapi.dll from an Android SDK. Plug the Dream in via USB and point to the location of the drivers when it is installed. Then open your command line, navigate to whatever folder adb.exe is in and type adb install <full path to the apk>. If you run Linux hopefully you can figure it out on your own based on the steps above.
Alternately, upload all the apks you want to the internet somewhere. Check the box to enable installation from Non-market sources in the system settings, then type the full URL of the apk into the browser. The package installer will take over from there.
Here's how you do it. Assuming your G1 is rooted
1. Download the attched files, and copy them into your \system32 folder (Start > Run > %systemroot%\system32)
2. Sure your G1 is enabled for USB Debugging (Settings > Applications > Development > USB debugging) and that your G1 has the appropriate drivers installed. If not, download the USB drivers from HERE
3. Plug your G1 into your computer (Make sure you have USB 2.0 - Click here to find out how to check). When your G1 says "USB Connected" DO NOT click "Mount"..don't do anything
4a. Vista users - Follow these steps. For XP Users, skip to step 5
4b. On your computer, browse to the directory where the APK for your file is located
4c. Once located, hold SHIFT and right click on a blank area of the folder
4d. Click on "Open Command Window Here"
4e. Type "adb install nameofyourapkhere.apk" - without the quotes.
4f. It might say something like "daemon service not started" or something, but it will start it and continue. It'll then say something like 626k/1293k bla bla bla
4g. If it was successful, it will just say "Success". You can close the command window and SHAZAM! Your program will now be installed on your G1, and you can access it like any other program on your phone
5. XP Users - Follow these directions:
a) You can either go Start > Run > type CMD and press enter
OR
Windows Key + R > type CMD and press enter
Navigate to your APK file via the command prompt. For easy usage, put your APK file on your desktop. That way all you have to do is type "CD Desktop" into the command prompt
b)Type "adb install nameofyourapkhere.apk"
c)You may get a couple of messages like in the steps for Vista users
d)If all goes well, you too will get the success message
e)Enjoy your application!
Any confusions, let me know. Hope it helps, and Good Luck!
I've been using a local web server and the android browser.
untermensch:
Thats a possibility, but oddly enough, that requires a http-server
AGx-07_162:
With unicornasaurus's method above, you can install all the apk's you want... you can install apkinstaller and use that through that method, but you can just aswell install your apk's directly through it
I ran into the same problem. Here is the easiest ways to get the appinstaller on your G1. Download this file from your g1 browser or Gmail yourself this file, and download.
http://www.mediafire.com/?egy0mop2qqx

How can I install 3rd party apps into my HTC aria?

I tried to install Zenonia 2 from mediafire but it blocks the installation and don't have the setting to allows it to install since ATT took it off. Is there a way to get this app into my phone?
-----------------
Check the sticky thread, "Installing 3rd party apps."
Sent from my HTC Liberty using XDA App
I tried doing that but I got stuck stuck doing on step 7 Becuz there was no adb command
I had the same problem and unfortunately I didn't document what steps I took to resolve it. I think you need to run the Android SDK and look for either the SDK manager or some sort of module add-on option. Then you need to add the SDK tools that include ADB. For some reason it's no longer included in the general SDK download.
How to Sideload 3rd Party Apps:
(Rooting NOT required for this)
Download SDK Tool HERE
1: Un-RAR Android folder to root directory on PC (ie: C:\ )
2: Open CMD Prompt and type CD\ and hit Enter
3: Now type cd\android\tools Enter
4: Plug in Data cable and choose "Charge Only" on phone (always choose this)
5: Now in CMD prompt enter this command: adb install barcodescanner3.4.apk and press Enter
The SDK tool should install the Barcode Scanner app on the phone. Yay!! Success!!
**You can use this method to install .apk downloads onto the phone. For this demo i had already inserted
the Barcode Scanner app into SDK tools folder. the actual command should read as follows:
adb install c:\path to .apk file (ie: adb install c:\apps\filename.apk)
**I chose this app because you can use it to install other apps by scanning the barcode
found on many HTC App sites.
No need to go through all this trouble anymore. All you need to do is download "sideload wonder machine" from android central and whatever app you want to install. Its quick and painless and it allows you to sideload apps to your unrooted aria (or any android)
The only thing you must do to the phone is make sure you have usb debugging enabled under the development settings.
Sent from my cm6.1 Aria using XDA App
unteagle said:
How to Sideload 3rd Party Apps:
(Rooting NOT required for this)
Download SDK Tool HERE
1: Un-RAR Android folder to root directory on PC (ie: C:\ )
2: Open CMD Prompt and type CD\ and hit Enter
3: Now type cd\android\tools Enter
4: Plug in Data cable and choose "Charge Only" on phone (always choose this)
5: Now in CMD prompt enter this command: adb install barcodescanner3.4.apk and press Enter
The SDK tool should install the Barcode Scanner app on the phone. Yay!! Success!!
**You can use this method to install .apk downloads onto the phone. For this demo i had already inserted
the Barcode Scanner app into SDK tools folder. the actual command should read as follows:
adb install c:\path to .apk file (ie: adb install c:\apps\filename.apk)
**I chose this app because you can use it to install other apps by scanning the barcode
found on many HTC App sites.
Click to expand...
Click to collapse
If you see my post right above yours, you will see that this method doesn't work anymore since adb is not included in the SDK by default. You (or whoever wrote the original instructions) need to add the steps necessary to install adb in the SDK.
How u install the adb command?
Thank you CallMeAria. It works now!
GuardianC6 said:
How u install the adb command?
Click to expand...
Click to collapse
Guessing you don't need the instructions anymore since you got it working with the wonder machine, but just in case, you need to run the Android SDK Manager, choose whichever available package comes with ADB, I think it is Android SDK Tools Revision 8, then download and install that.
awesome
thanks it worked great
Download Android Central Sideload Wonder Machine.

New location for ADB

Last night I was doing a fresh install of Sabayon and one of the first things I setup was eclipse and the Android SDK. I thought I should let everyone know that the new SDK moves ADB from the 'tools' folder to a new folder called 'platform-tools'.
So you may need to change your environmental variables (in windows) or .bashrc file (in linux) to reflect this change. Otherwise ADB won't work. Most developers will already know this but new people and non devs will find the instructions for setting up ADB wrong as far as the path is concerned.
Ex:
c:\android_sdk\platform-tools
or
/home/[user_name]/android_sdk/platform-tools
Thanks, though this changed from v8 (2.3) of the SDK, when adb was also moved out of the SDK starter package and into an add-on.
Oh, so it was changed already in a previous update?
I'm more of a terminal guy myself (and use .sh scripts in recovery) and it shows now

Simplifying ADB installation

There's a lot of angst around getting ADB to work, particularly over USB, and it leaves a lot of folks frustrated. Some of the stuff I have seen is outdated for one and USB itself is problematic.
But, if you use Manual Nooter (for 1.2), GabrialDestruir baked in ADB Wireless, so it should be super easy to go from zero to ADB connected in nothing flat now. Here's some quick instructions that won't change.
1. Make sure you have Java installed (I'm sure you do). You *do not* need the JDK to do this!
2. Go to the android site and grab the Android SDK zip file (the windows executable *requires* the JDK so grab the zip file)
3. Unzip it to the root of your drive (it has the 'android-sdk-windows' folder in it)
4. Now go in the android-sdk-windows folder and launch sdk manager
5. Cancel out of the window that pops up with a list of a bunch of stuff
6. Click on available packages
7. Now expand 'Android Repository' and check 'Android SDK Platform-tools'
8. Now click 'install selected' and then 'install' on the next screen
9. After it finishes it will ask if you want to restart ADB, go ahead and select yes
10. Now do the standard path edit and add these two paths to your environment path: c:\android-sdk-windows\platform-tools and c:\android-sdk-windows\tools
11. On your nook, start up adb wireless and note the command it tells you
12. open a command window on your pc and type the command adb wireless gave you
Voila! You are using ADB to access your Nook Color! No special drivers or ini files, etc. I know there is an easy ADB USB thread, but I actually eventually had issues with that and went back to grab the original "official" kit to get things working. I just did the above on a fresh machine with nothing else and it worked flawlessly.
Anyway, I figured this might help a few people out there.

[GUIDE/Linux] Install Android SDK the "Linux way"

Hi everyone.
I will show you how to install Android SDK. After this installation, you will have CLEAN, FULLY WORKING Android SDK environment useful for PROGRAMMING, using ADB utility and for OTHER THINGS. Note that this installation will work for ALL users on one computer, so its SYSTEM-WIDE installation (best solution).
This GUIDE WILL WORK WITH ALL LINUX DISTROS (tested on Arch/Debian, 32bit PC).
------------------------------------------------
WHAT WILL YOU NEED?
- Android SDK installation files (download file for LINUX, android-sdk_rXX-linux_x86.tgz - remember to replace "XX" with actual version number you have downloaded)
- Linux machine
- internet connection
- text editor (gedit, Kate, nano or any other)
- tar (is preinstalled on all Linux distros)
------------------------------------------------
LET'S GO
Download Android SDK for Linux and store that android-sdk_rXX-linux_x86.tgz file in your home directory.
Launch terminal and navigate to your home folder with this command:
Code:
cd ~
Extract downloaded android-sdk_rXX-linux_x86.tgz file with this command:
Code:
tar xvzf android-sdk_rXX-linux_x86.tgz
After extraction, you have "android-sdk-linux_x86" folder in your home directory. Now we will copy this folder into /opt folder (i chose this folder, because its used even for JDK and its system wide directory). Copy extracted folder with this command:
Code:
sudo mv android-sdk-linux_x86 /opt/android-sdk
After this, Android SDK is copied into /opt directory.
Now we have to register our Android SDK paths with our Linux system. Path to our Android SDK is now /opt/android-sdk/. We can find folders add-ons, platforms and tools (for example) in this path. To complete Android SDK installation, open your ~/.bashrc file with your favourite text editor. If you use gedit, then use this command:
Code:
gedit ~/.bashrc
Text editor with text file opens now....
After its opened, scroll DOWN to the end of file and put on the LAST LINE of that file:
Code:
export PATH=${PATH}:/opt/android-sdk/tools:/opt/android-sdk/platform-tools
Then save file and exit text editor. This step added our Android SDK paths to Linux SYSTEM-WIDE path, so that we can use for example adb by simply typing "adb shell".
Basic installation is now complete. To make SDK usable, type this to terminal:
Code:
sudo android
If you use GNOME then write gksudo instead of sudo and when you use KDE, write kdesu instead of sudo.
ANDROID SETTINGS window will appear. Go to "Available Packages" and install
Code:
Android SDK platform-tools
Android Compatibility package
SDK Platfotm Android XX (select versions you wanna, select at least one - for example 2.3.3)
After things are downloaded and updated, close that Android Settings window.
Log out and log in to complete installation.
CHEERS!!!
If you like this GUIDE, then HIT THX button.
Have a nice day.
Why are you spamming the forum with this unnecessary cruft?
Duh... download file from web.
Extract.
done.
I mean what are you trying to do? Confuse people and drive them by force to apple?
Not everyone is as SMART as(s) you are.
So keep quiet if you have nothing positive to say to this thread.
sudo android
sudo: android: command not found
I also found this script (for ubuntu) very helpful https ://github.com/AdnanHodzic/android-sdk-installer
And it is possible to just install the eclipse plugin as a user, it will pull in the sdk. (Don't forget to install the i386 libs though)
1) Download the Android SDK for Linux and follow Google's setup directions.
2) Drop the ADB binary into /usr/bin.
3) Edit /etc/udev/rules-d/51-android.rules to read your phone.
thanks dude..I`ll try install on my debian..
kalidgate said:
sudo android
sudo: android: command not found
Click to expand...
Click to collapse
+1
HOXnoo8 said:
+1
Click to expand...
Click to collapse
cd into tools and run android
./android
This will open a GUI that allows you to download various APIs and tools such as adb and fastboot
Sent from my Nexus 7 using XDA Premium 4 mobile app

Categories

Resources