android

Developing an Android smartphone app - on which devices would YOU suggest to check the app?!

Dear stackies, before publishing a new app on the market, on which devices would you suggest to check whether it runs fine or not? What are your experiences? How do you handle this? Are there some empirical values, for example, do applications that run smoothly on a HTC Desire behave similar on all HTC devices? Are there some devices o...

Compile Android camera application for sdk 1.6

I am trying to compile and run the Android Camera for sdk 1.6 (also called API level 4 or Donut release). While there is no minSdkVersion in the AndroidManifest, it clearly does not run on a donut device. In fact, if compiled with sdk 2.2 the camera will crash with a NoSuchMethodError execption on an avd or a G1 with sdk 1.6. I tried...

Android SQLite Index Optimization

I am optimizing our database for Android SQLite. The data is simple, 3 ints (Country, State, City) The data is stored in order by Country, State and City. If I create an index on the three fields in ASC, would that be the most efficient given that we "READ-ONLY" the data 100% of the time by the 3 fields? ...

Android wifi power question

I have observed that by default the wifi adaptor goes into (power saving mode) PSM mode. When Certain applications such as youtube appear to buffer video, the adaptor leaves PSM mode into CAM state or full power mode. Once the buffering is done, the wifi adaptor goes back into PSM mode. I have observed this behavior with other appl...

Update AppWidget from within program?

I need to update my AppWidget when my main activity pauses. I tried using the following code in my main activity's onPause(): super.onPause(); AppWidgetManager manager = AppWidgetManager.getInstance(this); int[] a = manager.getAppWidgetIds(new ComponentName(this, "WidgetProvider")); new WidgetProvider().onUpdate(this, manager, a); Wh...

Eclipse New Project (From Sample) Defaults to Errors

I don't know much about Java or Android development, so I'm digging into it myself. But I noticed that if I open sample code that came with my new 2.2 SDK, Eclipse by default will contain errors until I open up specific files. Is this normal for IDEs? Or is there something I'm missing? I am having to use Eclipse 3.5.2 since Google sa...

android service startService() and bindService()

Hello,I would like to know if it is possible to have a service that is started with startService and then be able to also bind to that service and do some remote procedure calls? according to this:http://developer.android.com/guide/topics/fundamentals.html#servlife the two services have different lifecycle so it's not possible,does anyo...

android UI - adding a new class

I would think this should be a relatively easy question to answer, but I'm brand new to android development and so not sure where else to turn. I have a simple layout (relative currently) for my main Activity. I want to create an object (a card for a card game) that will have all of the necessary properties for that card (value, suit, ...

Android IME: showing a custom pop-up dialog (like Swype keyboard) which can enter text into the TextView

I'm wondering how I can create a custom pop-up like the one in the screenshot below (borrowed from the Swype keyboard), where I can have a couple of buttons, which each commit a string to the currently "connected" TextView (via a InputConnection). Please note: this is an InputMethodService and not an ordinary Activity. I already tried ...

Android java.net.UnknownHostException: Host is unresolved

This code doesn't work: URL url = new URL( xmlPath ); InputSource input = new InputSource( url.openStream() ); all the time, resulting in an UnknownHostException, even when the host exists, has been hit successfully using the same code if from a different development host (machine), and also from a browser. I'm probably out...

How to set the Android Live Wallpaper icon?

I built my first Android app. It is a Live Wallpaper designed for 2.2. When I press and hold the screen, select Wallpapers and then select Live Wallpapers, my live wallpaper has what looks like a default icon with the name of my live wallpaper overlaid. How do I set this icon? My manifest file has an application icon specified as @...

android how to handle when a service is killed by OS or taskmanager

Hello I have a service that starts on boot on my android device,the service is started using startService command so it runs saperatelly from the UI, I would like to be notified when the service is killed from the OS or from the task manager so I can be able to saffelly save my data, I have override the onDestroy method but when the ser...

Need info on google contacts sync..

In android...once logging in into the google account after all the contacts from google server is synced is there any intent being broadcasted by the google mail app which tells that the google contacts are synced from the server? Could someone provide some info on this... ...

Creating ViewHolders for ListViews with different item layouts

I have a ListView with different layouts for different items. Some items are separators. Some items are different because they hold different kinds of data, etc. I want to implement ViewHolders to speed up the getView process, but I'm not quite sure how to go about it. Different layouts have different pieces of data (which makes nami...

WeView and Media Content play!

Hi, I would like to know if the WebView browser understands an embedded HTML media object and plays in the media player or do we have to start a Media Player activity to play the media content? Thanks, Sana. ...

Can anybody explain OAuth to an idiot?

That idiot being me. I've read a bit about it at http://oauth.net/ , it's "a simple way to publish and interact with protected data" apparently. I think it's exactly what I need to provide a secure way of accessing data from an android/iphone app via a REST web service, but I can't work out exactly what it is. So, put simply, what exa...

Internal memory vs. external storage in Android

I've started seeing some apps that offer to read/write data to the internal phone memory (like Super KO Boxing 2, which offers to save a whopping 52MB to the phone memory). I suppose this is because newer Android devices have a lot of internal storage, as opposed to my devices, which have very little. I would like to support internal s...

Android Java : How to subtract two times ???

I use some kind of stopwatch in my project and I have start time ex: 18:40:10 h stop time ex: 19:05:15 h I need a result from those two values like final time = stop - start I found some examples but they all are very confusing . Is there any simple solution ? ...

How to get Android compass reading?

Now that SENSOR_ORIENTATION is deprecated, what's the best practice for obtaining compass heading? The old way was so simple. ...

How to get YouTube Videos to show up & play in Android Apps??

Our Android app loads RSS feeds for news and blog sites and displays the stories in a webview. Whenever a story has a YouTube video, the video doesn't show up and it doesn't play (the object is there, but it's just whitespace & nothing happens when you tap it) Surely, since Google owns both Android and YouTube there's simple way to all...