android

Pitfalls of Android applications

Are there pitfalls or the points to remember while programming for Android? I think the list will include topics on Multithreading, Persistent Storage, etc. ...

How to use an intent to update an activity?

Hi I have a service that is downloading a file. When the download is done, I would like to update my "Downloaded files" list in my Activity, but only if the Activity is running. I do not want the Activity to start if it's not already running. I was hoping I could do this by making a new Intent with some special flag. Anyone have any i...

Looking for information on Android's Sync Manager

I haven't been able to find any documentation on Android's sync services, so far I just have the sources from the open source project which are a good start, but I am looking for architecture information, gotchas, etc. Thanks. ...

Wrong state class -- expecting View State exception in Android 1.5 with Custom View

When I switch to landscape mode, the following custom view throws an exception in Android 1.5r3 cupcake: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.opentable/com.opentable.activity.SearchResults}: java.lang.IllegalArgumentException: Wrong state class -- expecting View State public class TextProgressBar...

Executing Python Scripts in Android

This link says that Android support Python, Lua and BeanShell Scripts, subsequently for Perl too. If it is so, is it possible for developers to write python scripts and call them in their standard Java based android applications? ...

Android streming audio/video can't stream a rtsp file?

I want to stream a media file on web, and android developer website has said that MediaPlayer.setDataSource() can set the data source (file-path or http/rtsp URL) to use. But I got an error in both G1 device and emulator when streaming a rtsp url file: Command PLAYER_PREPARE completed with an error or info PVMFailure error(1, -1). Does ...

Maximizing an AlertDialog?

I'd like to show a Dialog that occupies as much screen space as possible. So, here's a sample: AlertDialog dialog = new AlertDialog.Builder(ctx)......create(); Window w = dialog.getWindow(); WindowManager.LayoutParams lp = w.getAttributes(); lp.width = 320; lp.height = 480; w.setAttributes(lp); Problem is, this doesn't change a thing...

Render Two images in ImageView in Android ??

Hi, I am trying to write an application, that would allow me to render multiple images onto an ImageView in Android. I can find the method to populate it with a sigle bitmap. But, there seems to be no way of getting two images to render in ImageView (Each occuping half the render space). Any help would be really appreciative. Thanks, D...

How to set mobile system time and date in android?

When you want to change the mobile system date or time in your application, how do you go about doing it? ...

Problem with "ViewHolder" class in android

I have a problem when use "ViewHolder" class. I use "ViewHolder" to improve my List display speech. I think the code is ok, but why It throw exception when "setText" with data from "Cursor". My code here: if(row==null){ LayoutInflater inflater = LayoutInflater.from(context); row = inflater.inflate(R.layout.sbooks_row, null); ...

Android as a commercial game platform.

Hi! I'm currently developing a small non-commercial game for Android which is based on OpenGL ES. Except for some minor issues (slow as crap emulator being the biggest) I've really enjoyed it so far and would love to continue developing for it. The question is: What are your thoughts on the future of Android as an environemnt for the g...

Future versions of Android and test devices - possible problems

Hello, guys, In the last couple of days, there were some speculations, circulating through the blogosphere, that the future versions of the Android OS, created from the branches Donut and Eclair, won't be compatible with the T-Mobile G1 and Android Dev Phone 1, because of insufficient OS flash storage on those devices. While that's not...

Android: Is it possible to display video thumbnails?

Hi, I created a video recording application with library dialog. The library dialog displays the list of recorded videos where each item consists of icon, video title, tags and location information the following way: Does anyone know whether it is possible to replace icons with video thumbnails (single frame preview)? Thanks! ...

How can I use external JARs in an Android project?

I have created an Android project and added an external JAR (hessian-4.0.1.jar) to my project. I then add the JAR to the buildpath and check it of in Order and Export. Order and Export is ignored it seams, and all classes from the external JAR is missing in runtime. Is there a trick to properly include the needed classes from an extern...

Best way to deal with different Android screen sizes?

We are writing an application for the T-Mobile MyTouch which is an Android based mobile phone. We have images that will be displayed on the default screen portrait mode (320 x 480). Anticipating that the Android OS will be appearing on Netbooks with default landscape 16 : 9 screen format, what is the best way to handle images that are ...

Android Spinner: Get the selected item change event.

How can you set the event listerner for a Spinner when the selected item changes> basically what I am trying to do is something similar to this: spinner1.onSelectionChange = handleSelectionChange; void handleSelectionChange(Object sender){ //handle event } ...

Android CursorAdapters, ListViews and background threads

This application I've been working on has databases with multiple megabytes of data to sift through. A lot of the activities are just ListViews descending through various levels of data within the databases until we reach "documents", which is just HTML to be pulled from the DB(s) and displayed on the phone. The issue I am having is that...

How to best handle fling gesture for Android ListActivity

I have an Android app with a ListActivity in the main view. The list contains a LinearLayout with a TextView and a hidden delete Button. The delete Button will be hidden by default. I want to use a fling gesture to show the button. I am able to detect the fling gesture thanks to question #937313 on stackoverflow. It's not clear to me ho...

Draw text in OpenGL ES (Android)

Hi! I'm currently developing a small OpenGL game for the Android platform and I wonder if there's an easy way to render text on top of the rendered frame (like a HUD with the player´s score etc). The text would need to use a custom font also. I've seen an example using a View as an overlay, but I don't know if I want to do that since I...

problem in Overriding default backkeys function

In my application,i override the android's backkey default functions(by Override onkeydown).its works fine.But when a spinner components default selecting elements windows and virtual keypad(In Android 1.5) enter into the screen the default back keys functionality collapsed because of my overriding. is there any way to solve this proble...