Alert.png

Notice: This page contains information for the legacy Phidget21 Library.

Phidget21 is out of support. Bugfixes may be considered on a case by case basis.

Phidget21 does not support VINT Phidgets, or new USB Phidgets released after 2020. We maintain a selection of legacy devices for sale that are supported in Phidget21.

We recommend that new projects be developed against the Phidget22 Library.


Click on the 2phidget22.jpg button in the menu bar to go to the Phidget22 version of this page.

Alert.png

OS - Android: Difference between revisions

From Phidgets Legacy Support
No edit summary
Line 32: Line 32:
#*[http://www.eclipse.org/downloads/ http://www.eclipse.org/downloads/] (for Windows or MacOS)
#*[http://www.eclipse.org/downloads/ http://www.eclipse.org/downloads/] (for Windows or MacOS)
#*<code>sudo apt-get install eclipse</code> (for Linux)
#*<code>sudo apt-get install eclipse</code> (for Linux)
#*Make sure to update Eclipse before installing the Android SDK
# The Android SDK package for your development system
#*See the download instructions link at [http://developer.android.com/sdk/installing.html http://developer.android.com/sdk/installing.html]
#*For 64-bit Linux, you will need the <code>ia32-libs</code> package as well, try:
#*For 64-bit Linux, you will need the <code>ia32-libs</code> package as well, try:
#*:{{Code|sudo apt-get install ia32-libs}}
#*:{{Code|sudo apt-get install ia32-libs}}
# The Eclipse plug-in for Java development
# The Eclipse plug-in for Java development
#*[http://www.eclipse.org/downloads/ http://www.eclipse.org/downloads/] for Windows or MacOS
#*<code>sudo apt-get install eclipse</code> (for Linux)


=====Install the Android SDK=====
====Android SDK (and Eclipse Plugin)=====
 
# The Android SDK package for your development system
#*See the download instructions link at [http://developer.android.com/sdk/installing.html http://developer.android.com/sdk/installing.html]


Google's instructions for installing the Android SDK may be found here:
Google's instructions for installing the Android SDK may be found here:

Revision as of 19:45, 2 April 2012


Icon-Android.png Android is a mobile OS commonly used on smartphones and tablet computers.

Tablets with a USB port and Android version 3.1 or greater can control Phidgets directly plugged in to them. Earlier Android versions (tested down to 2.1) can control Phidgets over a network using the Webservice.

Getting Started (Libraries and Drivers)

If this is your first Phidget, we highly recommend working through the Getting Started guide for your specific Phidget device.

Android code is developed on an external platform anyway (i.e. Windows, Mac OS, or Linux), and so getting your Phidget to work locally on that platform first will help you distinguish any issues from network ones later.

Near the end of the Windows, Mac OS, or Linux setup process, we direct you to choose a language. At that point, please remember to return here to this Android Java page.

Alternately, you can first try using mainstream Java. On the mainstream Java page, we provide example code - including code that works on the Android development platform of Eclipse - to test your Phidget directly from your development computer.

Installing

Eclipse (Android Java Development Platform)

Development for your Android OS Phidget application can occur on Linux, Mac OSX, or Windows.

You will need the following:

  1. The JDK and Java on your development system
    • See the mainstream Java page for details on Java for Windows, Mac, and Linux
  2. Eclipse (a Java Integrated Development Environment) on your development system
    • http://www.eclipse.org/downloads/ (for Windows or MacOS)
    • sudo apt-get install eclipse (for Linux)
    • For 64-bit Linux, you will need the ia32-libs package as well, try:
      sudo apt-get install ia32-libs
  3. The Eclipse plug-in for Java development

Android SDK (and Eclipse Plugin)=

  1. The Android SDK package for your development system

Google's instructions for installing the Android SDK may be found here:

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

That link contains help and code for:

  • Installing the SDK and platform emulators
  • Connecting the SDK into Eclipse, which is useful for following the example descriptions later

To check that the JDK, the Android SDK, and Eclipse have all been configured correctly, use the Google HelloAndroid example:

http://developer.android.com/resources/tutorials/hello-world.html

Once you have confirmed that the Android SDK has been correctly installed, you are ready to begin developing applications with the Android Java libraries and language.

Phidget Libraries

Permissions

Checking

Software

Hardware

Troubleshooting

Programming Languages

Android OS programs are written in Android Java using the Android SDK and the Phidgets library.

Note that Android Java is NOT the same as mainstream Java. Any Java programs you have will probably need significant modification before they run on Android, including our mainstream Java Phidget Examples

Webservice

Setting Up the Webservice

Using the Webservice

Advanced Uses

Common Problems and Solutions

If you are having trouble, ensure your Phidget libraries are up to date.