android

Android ListView - Multiple <Selector> Tags

Is it possible to have multiple selector tags on a single listview...ie: change the background color of each item of the listview (alternating between two drawables), but still have the selector of the list view active for focus and click events? Also, is it possible to ensure that the margin stays constant when using selector tags? Fo...

How to avoid memory leaks in frame animation?

I've created simple test app with one activity. The activity contains frame animation. The total size of images in frame animation(riffle_forward_anim) is about 1MB. Here is the code I use to load animation: public class MainScreen extends Activity { /** Called when the activity is first created. */ private ImageView imgForward; priv...

Getting Android Traceview to work

When I try to run traceview I get: 'java' is not recognized as an internal or external command, operable program or batch file. SWT folder '' does not exist. Please set ANDROID_SWT to point to the folder containing swt.jar for your platfo rm. I can't figure out how it get it working. Does anyone know? ...

Android NDK future extended support for C++

Is there any info about the future of extending the safe C++ header list in the NDK (or maybe some hints to what might be safe to use) ? Or how soon we can expect the next NDK update? Also will there be any tutorials and documentation comming out for the NDK? Thanks ...

Android - I want to show file upload progress to the user

I upload photo to the server via the default HttpClient in Android SDK. I want to show progress in the user interface, is there a way to find out how much has been uploaded? Is it possible with HttpUrlConnection? ...

android: Source Not Found when setOnClickListener

I have a listview that I want to add event listener to it. The following simple code exits with "Source Not Found" when debugging. I remembered using exactly the same code for Button object and it did not caused any problem. mArticleList = (ListView)findViewById(R.id.ArticleList); populateArticleList(); mArticleList.setOnClickL...

Need help understanding boundCenterBottom()

Hey all, Trying to replicate the behavior of ItemizedOverlay.boundCenterBottom(), inside of one of my Overlay classes. I am fairly certain that I can do this using setBounds(), but I am utterly lost as to what setBounds() is actually doing. Thanks, Hamy ...

value/strings.xml vs. layout/*.xml

Can anybody enlighten me why value/strings.xml is useful(important)? It occurred to me that all the attributes, e.g., id, label can be set in the layout xml as well. So why strings.xml? A side question is, once get an ID of an object, say a listitem, how do I get the android:text from it? I did not find any getText() function. ...

Android: How to highlight EditText programmatically?

requestFocus() moves cursor to edit box, but does not highlight it. I want to highlight it like as if it was touched. ...

An SDK Target must be specified.

I'm really new at this. I'm following the book "Android" by O'Reilly press a little outdated, I'm using Pulsar for Mobile Java Developers. Build id: 20090920-1017 I go to File, New Project, Android, Android Project. I enter "Hello World" for Project Name. Then I get "An SDK Target must be specified." There is a check box but it says "no ...

SensorManager.registerListener wants a SensorListener despite its depreciation...

@Override protected void onResume(){ //super.onResume(); sensorManager.registerListener((SensorListener) listener, SensorManager.SENSOR_ACCELEROMETER |SensorManager.SENSOR_ORIENTATION, SensorManager.SENSOR_DELAY_NORMAL); } private SensorEventListener listener=new SensorEventLi...

Getting Android source

I trying to get the source of android using repo and git. Everytime I do a repo sync, the terminal indicates that it is fetching projects but it will freeze at that particular line for hours. I am guessing that my network is behind a firewall. Which port should I open? or What should I do? ...

Can I retrieve a locale independent application label from the Android PackageManager?

I'm using PackageManager.getApplicationLabel(ApplicationInfo) to retrieve application labels. It looks like the label that is returned depends on the Locale set for the phone. For instance with the music app I get "Music" in English, vs. "Musica" if I have my locale set to Spanish. Is there a way to get the default application label (...

How to write a Bitmap out to a XML file

Might sound crazy, but it's what I need to do. I want to take a Bitmap object and use the XMLPullParser/XmlSerializer to write this to a flat file. Obviously I will need to read the XML tag back into a Bitmap object. I have tried various things, similar to how I write and read Bitmaps from a database. Bitmap bitmap = ((Bi...

Performance TestCase Interface in Android

Hi.. Has anybody implemented the PerformanceTestCase provided by android and got some results...If you have done it please provide some source code,it will be really helpful... Here is the android link: http://developer.android.com/reference/android/test/PerformanceTestCase.html I have used the traceview tool but I need results like CP...

Cannot execute OnItemClick for GridView in PopupWindow

I have a gridView that I display in a popupwindow (the gridview is in a transparent layout, which inherits from linearlayout and just has a partially transparent background). I can never get this GridView's OnItemClick to execute. When I touch an image in my gridview it appears to be clicked (image bachgrond changes), but OnItemClick i...

PhoneStateListener events stop receiving sometime

Hi, My application process incoming/outgoing calls and shows some UI. So I use PhoneStateListener to listen changes such as CALL_STATE_IDLE , CALL_STATE_RINGING ,CALL_STATE_OFFHOOK. on receiving call to my BroacastReceiver for incoming/outgoing call. Most of the time things work properly. But sometimes my application does not rec...

android - pass value back to the same activity on a button click and refresh the page

Hi, I need to pass a value back to the same activity and refresh the activity to generate new data. Can anyone please provide me some ideas/guidance on how to do it? Thank you. I had try using intent to call the same activity but it doesn't work. Here is the code which i tried to use intent: btn_next = (ImageButton) findViewById(R.id.b...

How to create a table with borders in android

I use table layout for for display data as table .But i want table with userdefined columns and rows with borders.Give me suggestions? ...

how to pass parameter to a webservice using ksoap2?

hi there, i'm using eclipse to develop over android, i'm trying to connect to a .net webservice... when i'm calling a webmethod with no parameters it works fine... but when i come to pass a parameter to the webmethod things turn upside down... the parameter is passed as null (while debugging the webservice i discovered that) and i get a ...