Android: How To. Thanks. Aman Nijhawan



Similar documents
Android Development Tutorial. Nikhil Yadav CSE40816/ Pervasive Health Fall 2011

Getting Started with Android Development

Android Environment SDK

Hello World. by Elliot Khazon

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

ADT Plugin for Eclipse

Lab 0 (Setting up your Development Environment) Week 1

OpenCV on Android Platforms

Android Environment SDK

Installing the Android SDK

Oracle FLEXCUBE Direct Banking Android Tab Client Installation Guide Release

How to build your first Android Application in Windows

l What is Android? l Getting Started l The Emulator l Hello World l ADB l Text to Speech l Other APIs (camera, bitmap, etc)

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

Android Development. 吳 俊 興 國 立 高 雄 大 學 資 訊 工 程 學 系

How to Create an Android Application using Eclipse on Windows 7

IOIO for Android Beginners Guide Introduction

Android Development Setup [Revision Date: 02/16/11]

How To Run A Hello World On Android (Jdk) On A Microsoft Ds.Io (Windows) Or Android Or Android On A Pc Or Android 4 (

With a single download, the ADT Bundle includes everything you need to begin developing apps:

Building graphic-rich and better performing native applications. Pro. Android C++ with the NDK. Onur Cinar

Introduction to Android

App Development for Smart Devices. Lec #2: Android Tools, Building Applications, and Activities

Developing In Eclipse, with ADT

Tutorial on Basic Android Setup

Example Connection between USB Host and Android

How To Develop An Android App On An Android Device

Fahim Uddin 1. Java SDK

Android Programming: Installation, Setup, and Getting Started

Android 4.4 App Development Essentials

Android Setup Phase 2

How to Install Applications (APK Files) on Your Android Phone

Application Development Setup Guide

Android Development. Lecture AD 0 Android SDK & Development Environment. Università degli Studi di Parma. Mobile Application Development

System Reference 2013

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department. Mobile Computing ECOM Eng. Wafaa Audah.

Advantages. manage port forwarding, set breakpoints, and view thread and process information directly

Android Development. Marc Mc Loughlin

Epidefender Studio Installation notice

WA1826 Designing Cloud Computing Solutions. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

NVIDIA Tegra Android Platform Support Pack Getting Started Guide

Home Course Catalog Schedule Pricing & Savings Training Options Resources About Us

Android: Setup Hello, World: Android Edition. due by noon ET on Wed 2/22. Ingredients.

Android Introduction

Hudson configuration manual

Installing Oracle 12c Enterprise on Windows 7 64-Bit

CSA Software Listing Table of Contents. Both Windows and Mac platforms are supported.

Android Development Tools for Eclipse

Introduction to Gear VR Development in Unity APPENDIX A: SETUP (WINDOWS 7/8)

How to Set Up Your PC for Android Application Development

Titanium Mobile: How-To

Chipsee Embedded Industrial Computer Android User Manual V1.0.1

Android Programming. Høgskolen i Telemark Telemark University College. Cuong Nguyen,

How to Set Up Your PC for Android Application Development

Avalanche Remote Control User Guide. Version 4.1.3

Introduction to Android

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

CS 528 Mobile and Ubiquitous Computing Lecture 2: Android Introduction and Setup. Emmanuel Agu

Basic Android Setup Windows Version

directory to "d:\myproject\android". Hereafter, I shall denote the android installed directory as

Setting Up Your Android Development Environment. For Mac OS X (10.6.8) v1.0. By GoNorthWest. 3 April 2012

Colorfly Tablet Upgrade Guide

Java Software Development Kit (JDK 5.0 Update 14) Installation Step by Step Instructions

Developing NFC Applications on the Android Platform. The Definitive Resource

Download and Installation Instructions. Android SDK and Android Development Tools (ADT)

Introduction to Android: Hello, Android! 26 Mar 2010 CMPT166 Dr. Sean Ho Trinity Western University

Qualcomm IR-I 2 C Bridge Demo

USB DRIVER INSTALLATION GUIDE

Using Microsoft Visual Studio API Reference

Android Environment Emulator

Lab 4 In class Hands-on Android Debugging Tutorial

Android Programming and Security

An Introduction to Android

How To Develop Android On Your Computer Or Tablet Or Phone

SIM900 Eclipse environment install Application Note_V1.00

Supplement I.B: Installing and Configuring JDK 1.6

Eddy Integrated Development Environment, LemonIDE for Embedded Software System Development

EasyPush Push Notifications Extension for ios

Introduction to Android Programming (CS5248 Fall 2015)

Download and Installation Instructions. Android SDK and Android Development Tools (ADT) Microsoft Windows

Download and Installation Instructions. Android SDK and Android Development Tools (ADT) Microsoft Windows

Pentesting Android Mobile Application

Installing (1.8.7) 9/2/ Installing jgrasp

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

Board also Supports MicroBridge

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

GSM Click - Cross-Platform Development Quick Start Guide

Oculus Mobile Software Development Kit (SDK) Device and Environment Setup Guide

Module Title: Software Development A: Mobile Application Development

Super Pro Net TM Network Key Installation and Operation

Yocto Project Eclipse plug-in and Developer Tools Hands-on Lab

Five standard procedures for building the android system. Figure1. Procedures for building android embedded systems

Android Mobile App Building Tutorial

Intel Do-It-Yourself Challenge Lab 2: Intel Galileo s Linux side Nicolas Vailliet

Shearwater Research Dive Computer Software Manual

Running a Program on an AVD

New Technology Introduction: Android Studio with PushBot

Android Application Development

Intel Integrated Native Developer Experience (INDE): IDE Integration for Android*

Transcription:

Android: How To. This is just a collection of useful information and tricks that I used during the time I was developing on the android ADP1. In some cases the information might be a little old and new and easier ways to do the same things might be available. Please let me know if you find something like this so that, I can update this document. This is not original work and neither do I claim so. This is just a collection of references that you may find useful. This is in no way a definitive guide and there is much more information out there. Thanks Aman Nijhawan

Index Part 1: Activating your android ADP 1 without the sim card 2 Part 2: Installing the Developing Environment.. 3 Part 3: Part 3: Updating your Android phone to the latest Firmware 4 Part 4: APIs and links to code reference and sample code for accessing onboard Hardware.6 Part 5: Scripting on Android.7 Part 6: Compiling and Installing Linux Binaries for Android 9

Part 1: Activating your android ADP 1 without the sim card 1. Plug your Android Dev Phone into your computer via USB if you are using windows 64 bit as your OS you will need additional instructions about the driver*. 2. Get into the Phone's OS... Open up a terminal and type: adb -d shell 3. Now, change to the Phone's settings database directory, type: cd /data/data/com.android.providers.settings/databases/ 4. Give yourself admin permissions by typing: su 5. Now, you are going to use sqlite to alter the phone setting database, and turn provisioning on, so type: sqlite3 settings.db 6. Use this SQL command to alter the settings database: INSERT INTO system (name, value) VALUES ('device_provisioned', 1); 7. Now, exit sqlite by typing this (don't forget the "."):.quit 8. Reboot the Phone by typing: reboot 9. When the phone reboots, you need to open up the settings screen to activate your WiFi settings. 10. First, get back into the Phone's OS by typing: adb shell 11. Now, run this command to open up the settings screen on the Phone, which will allow you to turn on WiFi: am start -a android.intent.action.main -n com.android.settings/.settings *Windows Vista 64 bit Driver Issue: At the time of writing this document windows vista 64 bit did not have a driver for android platform, so there is an unsigned driver that is available for the phone. However the issue with windows Vista is that it won t allow you to install unsigned drivers without some hacks. ( I have attached the driver in the tar file 1. Type "bcdedit /set testsigning on" at an admin command prompt Reboot 2. Check to see if the desktop says "Test Mode" on the corners after reboot. 3. Install the given driver now.

Part 2: Installing the Developing Environment Once you have installed the android phone and looked around in the interface and checked out the command prompt emulator installed skype to make free calls over wifi and got the hang of the device, its time to get down to serious business. The android development environment is basically a Stripped down version of J2ME environment. 2.1 Installing Android SDK: 1. Download Eclipse(3.4) from : http://www.eclipse.org/downloads/ 2. Install Jdk6 preferably if you don t have it already installed. 3. Download the Android SDK for your eclipse version and OS from http://developer.android.com/sdk/1.5_r3/index.html 4. Installing 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, and debug using the Android SDK tools. Eclipse 3.4 (Ganymede) 1. Start Eclipse, then select Help > Software Updates... 2. In the dialog that appears, click the Available Software tab. 3. Click Add Site... 4. Enter this as the Location: https://dl-ssl.google.com/android/eclipse/ Alternatively, you can use http in the Location URL, if you are having trouble with https http://dl-ssl.google.com/android/eclipse/ Click OK. 5. Back in the Available Software view, you should see the plugin. Select the checkbox next to Developer Tools and click Install... 6. On the subsequent Install window, "Android Developer Tools", and "Android Editors" should both be checked. The Android Editors feature is optional, but recommended. If you choose to install it, you need the WST plugin mentioned earlier in this page. Click Next. 7. Accept the license agreement and click Finish. Restart Eclipse. Now, you just need to modify your Eclipse preferences to point to the Android SDK directory:

1. Select Window > Preferences... to open the Preferences panel. (Mac OS X: Eclipse > Preferences) 2. Select Android from the left panel. 3. For the SDK Location in the main panel, click Browse... and locate the SDK directory. 4. Click Apply, and then OK. Done! 5. Hello World for Android: Go through the helloworld(s) give on this page to get a feel of the developing environment. http://developer.android.com/guide/tutorials/hello-world.html 6. Go through 7. http://developer.android.com/guide/tutorials/hello-world.html Part 3: Updating your Android phone to the latest Firmware Please go through the useful ADB Commands before you move any further: http://developer.android.com/guide/developing/tools/adb.html Flashing the phone: The ADP1 phones given in class need to be updated first before you could try and work with them, I found this out because some of the code that I wrote was working on the simulator but not on the phone, hence the flashing. It is also necessary to flash the phone in order to run Android Scripting Environment. This is a long process and the best post I could find on this was: http://www.androidkit.com/flashing-firmware-images-to-the-adp1-device Please go through all steps carefully.

Part 4: APIs and links to code reference and sample code for accessing onboard Hard Hardware API CLASS Reference Links Device GPS android.location http://developer.android.com/reference/android/lo cation/locationmanager.html Sample Application http://blogoscoped.com/archive/2007-11-19- n27.html GSM Telephony android.telephony http://developer.android.com/reference/android/t elephony/package-summary.html Sample Application Listen to incoming SMS Application http://davanum.wordpress.com/2007/12/15/androi d-listen-for-incoming-sms-messages/ Get notification about incoming calls http://mylifewithandroid.blogspot.com/2008/01/ph onecalls.html Access Cell Details such as cell id, signal strength etc http://davanum.wordpress.com/2007/11/29/androi d-access-cell-phone-details-cell-id-lac-signalstrength/ http://davanum.wordpress.com/2007/11/30/androi d-poor-mans-my-location-show-current-celllocation/ Wifi android.net.wifi http://developer.android.com/reference/android/n et/wifi/package-summary.html Wifi Social Networking using maps and wifi http://www4.ncsu.edu/~ppmarqui/csc714/index.ht ml XML Parsing android.sax http://developer.android.com/reference/android/s ax/package-descr.html Sensors: Get information about the sensors present on the device. Sensor http://developer.android.com/reference/android/h ardware/sensor.html

Accelerometer, Compass SensorManager http://developer.android.com/reference/android/h ardware/sensormanager.html Camera android.hardware http://developer.android.com/reference/android/h ardware/package-summary.html Part 5: Scripting on Android Android Scripting allows development of applications on the phone itself, without the need to be tied to a computer. ASE or android scripting environment allows you to edit and execute scripts and interactive interpreters directly on the Android device. Languages supported currently: Python, Lua, Perl, Jruby, Beanshell. You can download ASE on the phone from: http://android-scripting.googlecode.com/files/androidscriptingenvironment-0.11-alpha.apk Install it as an apk package on the phone: Using adb install <source>/androidscriptingenvironment-0.11-alpha.apk /<destination> Open application & select your favorite interpreter and you will get a few sample scripts you can use these scripts and create your own script, either directly in the phone or on a computer on your favourite IDE and use adb push to push the script to the phone. adb push myscript.py /sdcard/ase/scripts/myscript.py For details on scripting you can visit the following links: http://community.developer.motorola.com/t5/motodev-blog/scripting-android-by-mike- Riley/ba-p/1426 http://google-opensource.blogspot.com/2009/06/introducing-android-scripting.html http://code.google.com/p/android-scripting/wiki/pythonandroidapi http://code.google.com/p/android-scripting/wiki/luaandroidapi

Part 6: Compiling and Installing Linux Binaries for Android Note: Your Development Environment for this should be Linux to setup the tool chain compiler I have had some success with the process given at http://android-dls.com/wiki/index.php?title=compiling_for_android apt-get install emdebian-tools emsetup --arch armel To compile simple static applications: arm-linux-gnueabi-gcc -static -o myapp myapp.c So the limitation here is that the application is statically linked. A nicer setup would give us dynamically linked applications. One of the trickier aspects here is that Android uses a custom, tiny libc, (bionic). Here are some instructions on getting a working setup for compiling a dynamically-linked program with the prebuilt Android toolchain. Perhaps someone can use these instructions to create a simpler process using the emdebian toolchain. To get the Android prebuilt toolchain: 1. First download the Android source. 2. That ships with a prebuilt toolchain with a compiler named something like arm-eabi-gcc. It's convenient to get that onto your PATH with something like the following (assuming Android source in $HOME/src/android): export PATH=$HOME/src/android/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin 3. Next you'll actually need to compile at least the bionic libc. Without having gone through the effort of doing a minimal compile here, you can do just "make" and wait quite a while for all of Android to get compiled. Note that early on the Makefile will abort if it can't find a JDK that it likes. Presumably no Java is actually needed for the native compilation we're doing here, but again, without having wrestled that out of the Makefiles yet, you can satisfy that requirement with packages from Debian's main repository: apt-get install openjdk-6-jdk

4. Next, there are various flags and things needed to cross-compile an application and properly link it to bionic. Andrew Ross has written a perl script to take the pain away here and with the android toolchain in your PATH you're ready to go. Grab his agcc script and put it into your PATH somewhere, (perhaps in $HOME/bin or so). 5. With all those steps done you can now cross-compile an application dynamically linked to bionic agcc -o myapp myapp.c Agcc perl wrapper can be found at: http://plausible.org/andy/agcc You can then push myapp using adb on to the android device, I used it to port and run iptables on android, however this was not very stable when I did it maybe this can be improved upon.