android

Android on VMWare or VirtualBox

Can Android OS that is installed on actual devices be emulated in VMWare or VirtualBox. Are there any such distros or images available? ...

Better way for "refresh" and "setSelection" after Update ListView (android)

In my ListView, I choose an Item to "Add Favorite" and I have to do some stuff work, I fill data again to refresh the List, then I implement OnScrollListener use setSelection(firstVisibleItem) to set List display right on Item was added. Are there any better way to do that. I mean like mCursor.requery() or something like that in android...

Android: How to bind spinner to custom object list?

Hi, In the user interface there has to be a spinner which contains some names (the names are visible) and each name has its own ID (the IDs are not equal to display sequence). When the user selects the name from the list the variable currentID has to be changed. The application contains the ArrayList Where User is an object with ID an...

Problem with EditText background (android)

I have a problem with EditText background like this <EditText android:id="@+id/edit" android:layout_width="fill_parent" android:layout_height="35sp" android:singleLine="true" android:layout_marginLeft="5px" android:layout_marginRight="5px" android:layout_marginTop="5px" android:textAppearance="?android...

How to use Parcel in Android?

I'm trying to use Parcel to write and then read back a Parcelable. For some reason, when I read the object back from the file, it's coming back as null. public void testFoo() { final Foo orig = new Foo("blah blah"); // Wrote orig to a parcel and then byte array final Parcel p1 = Parcel.obtain(); p1.writeValue(orig); ...

Android:Screen Off and Lock Notfication?

Hello, I want to continue running my application when the backlight and screen goes off and lock. How do i find out whether the device screen goes off and lock from my application through notification so that i can ignore it and continue running my app.? Appreciate your help. ...

How to store files in Android's cache directory ?

My goal is store temporary files in the directory returned by Context#getCacheDir(). /data/data/my.app/cache/somedir/foo.json I presume I can just use java.io apis to write files there. But I'm not sure how to set permissions on files there because I would not be able to use Context#MODE_PRIVATE. The filename parameter to Context#ope...

Android - using background service

I have a mix-case IDL service that I'm using in 2 ways: The service will spawn a thread and make a network call to grab some XML content on Activity's behalf. The content is return back to the Activity through client's IDL that defines callback methods If user chooses notification option then service creates a Timer that gets executed ...

Android: Read from TextView or write to it automatically

Hi all I am a new to android I wish to write automatically from code to TextViw and read in code from TextView What is the best way to do it. ...

Tutorials and libraries for OpenGL-ES games on Android

What tutorials and libraries are available which can help beginners to develop 2D and 3D games on Android using OpenGL-ES? I'm looking for tutorials which can help me learn OpenGL-ES, and I'm looking for OpenGL-ES libraries which can make life easier for beginners in OpenGL-ES. Since Android is still small, I guess it may be help-full t...

Android: Problem/bug with ThreadSafeClientConnManager downloading images

For my current application I collect images from different "event providers" in Spain. Bitmap bmp=null; HttpGet httpRequest = new HttpGet(strURL); long t = System.currentTimeMillis(); HttpResponse response = (HttpResponse) httpclient.execute(httpRequest); Log.i(TAG, "Image ["+ strURL + "] fetched in [" + (System.currentTimeMi...

Android: Accelerometer false detection

I have a code snippet to detect accelerometer movements. It works some times by properly detecting slight movements, but sometimes it detects movements when I kept my device idle too. Are there any problems with built-in accelerometer detection on Android? I use an HTC G-1 device. My code snippet is below. How do I resolve it so I can d...

JPA Annotations in Android

Hello, We have a project that uses JPA/Hibernate on the server side, the mapped entity classes are in their own Library-Project and use Annotations to be mapped to the database. I want to use these classes in an Android-Project - is there any way to ignore the annotations within Android, to use these classes as standard POJOs? ...

Strategies for large volume of location geocoding

I have an application that uses the Google Maps API to geocode distances between lat/long pairs as a way of displaying people near to you on your phone (currently Android, working on iPhone). The issue is that even with a test group of 40 users, we are taking upwards of 10 seconds to do our calculations and send the results back to the u...

Sorting results when autocomplete matches multiple columns in SQL

I've run into an issue with an autocomplete field I'm working on. The field I'm working with is composed of the form "<NAME> (<CODE>)". When a user starts typing in text, I want to display any results that match either NAME or CODE. For example, if this list contains items and their codes, like "Personal Computer (PC)", then I'd want ...

How to make a smooth image rotation in Android?

I'm using a RotateAnimation to rotate an image that I'm using as a custom cyclical spinner in Android. Here's my rotate_indefinitely.xml file, which I placed in res/anim/: <?xml version="1.0" encoding="UTF-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="0" android:toDegrees="360"...

Android: Twitter and OAuth anyone?

I was wondering if anyone got this working. I am trying to do a basic authentication but for some reason it keeps complaining "Could not authenticate you.". How would I go about getting it to run with OAUTH? ...

which sqlite statement can produce a result to indicate duplicate entries? Android

For my application, I am trying to add entries without having a duplicate entry, and if there are a duplicate notify the user and have him try again. Using SQLite, which I know very very little about, I have tried these two ways and want to know which one is better, more efficient or a better way to develop it? First way: db.execSQL("I...

How to synchronize content of one view depending on scroll position in sibling ScrollView?

I have extended LinearLayout (vertical) to create a custom compound component. This in turn contains two children: one custom view that is drawn directly onto the view canvas. one HorizontalScrollView->LinearView(Horizontal)->Multiple custom views. I would now like to redraw the custom view to match the visible contents of the scrol...

How to get a String array with java code from <string-item> list in arrays.xml in Android ?

Hi, I want to get an array of strings reading from arrays.xml file we add in android values/ folder. Could any one kindly give a solution for this. Otherwise I will have to input each these entries in strings.xml and take them to java code using getResources()getString() Thank you. Tharindu ...