Posts Tagged ‘Eclipse’

Posts that are somehow related or that needs to be done using this IDE.

Android: take a picture without displaying a preview

Click here to read Android: take a picture without displaying a preview

Accessing hardware functionality when programming for an Android device is generally quite straightforward. The same can be said about writing an Activity that takes a picture, but Android requires a preview of what the camera will capture to be displayed prior to capturing an image. This post explains how to “cheat” this requirement imposed by the OS, and how to write an application that takes a picture and displays it.

An Eclipse project with all the code explained here is available for download at the end of the post.

Before going into the Activity code, the interface layout (the main.xml file) must be edited to add a Surface View and an Image View to the interface. To add an element, just drag and drop it from the list inside your layout, like this: (more…)

Android: Retrieving the Camera preview as a Pixel Array

Click here to read Android: Retrieving the Camera preview as a Pixel Array

This post explains how to take the live images created by Android’s camera preview feature and return them as a RGB array, that can be used to all sorts of things, like custom effects preview and real-time image filtering. This post used the CameraPreview class that already comes bundled with Android’s SDK because it has everything already set-up, that way is just a matter of inserting more code. The techniques shown here works with Android 2.1 and should work with versions 1.6 and 1.5.

The first thing to do is to import the API Demos project to your Workspace. To do that, in Eclipse, click File -> New -> Android Project. In the dialog that has just opened, give the project a name at the first field (like API Demos 8) and select ‘Create project from existing source’. Now browse to <Android SDK folder>\samples\android-7\ApiDemos. Finally, mark Android 2.1 as the Build Target and click Finish: (more…)

Installing APK Files on Android Emulator

Click here to read Installing APK Files on Android Emulator

Not exactly code, but it’s programming related. Chances are, you already found a bunch of pages describing the process of installing a APK file on Android Emulator using the command line. Surely, it is the safest and most recommend method, but why go through all the trouble if you want to run the application just once or twice? If you are a Eclipse user, there is a easier way, that will be explained here.

First, choose a device you wish to start emulation from the AVD Manger.

AVD Manager Screenshot

Select a Android Virtual Device to start the emulator.

(more…)

Page 2 of 212