android

How to prevent sleeping in Android

Hello I 'm working with GPS in my application. When phone go to sleep, the GPS's data don't update. I want to stay phone screen wake up until my app will be close. How can I prevent sleeping in Android? ...

Going Back to Previous Screens

Hello all, I am new to Android programming and I'm trying to figure out how to go back to a previous screen/activity after opening another screen using startActivity. From all the research I've done, using the finish() method should bring up the previous screen just before the current one; however, in my test program (has four screens ...

how to take the text in an array which come from a resource ?

this is a part of my code : public void onItemClick(AdapterView<?> parent, View v, int position, long id) { TextView title_t = new TextView(this); title_t.setText(""); String title = title_t.getText().toString(); switch(position){ case 0 : new AlertDialog.Builder(this).setTitle(title).setMessage("blah blah").setNeutralButt...

If I install a different launcher on Android will the UI of everything be different?

I'm planning on buying a sony ericcson xperia x10 mini pro but I don't like the blueish UI I saw video of it running ADW Launcher and that looked great but, Does using a different launcher also change the UI in the texting/emailing screens? , I want to have homescreens like ADW Launcher and the texting/emailing UI should look like pure ...

Android: Highlighted tab of TabWidget not readable on HTC Sense

In my Android app I use a TabWidget without any special customization. I'd like Android to take care of the specific appearance, which works fine if you compare Android 1.6 with 2.1 for example. By just using a TabWidget the same code leads to different forms of tabs because the SDK defines how to draw it. Here is how it looks on 2.1 for...

Android onPause() or saveInstanceState()?

I have been working on my app and come to the point where I need to understand the Activity lifecycle and I don't think I get it. What I have is an Activity with seven buttons on it. When a user presses a button it opens a listActivity where a user can choose an item in the list, the title gets sent back to the calling Activity, and th...

How can I sense if the user is holding down their finger on the screen without moving it?

I am currently using pure OpenGL to paint buttons in my own little way. I can detect if a button is pushed with onTouchEvent, but I want to know if the user is holding the button down, or if the user is no longer touching the screen. ...

Android: Bitmaps loaded from gallery are rotated in ImageView

When I load an image frome the media gallery into a Bitmap, everything works fine, except that pictures that were shot with the camera while holding the phone vertically, are rotated so that I always get a horizontal picture even though it appears vertical in the gallery. Why is that and how can I load it correctly? ...

Google Maps slow when markers on it

Im writing a small webapp based on the idea of openspot for training proposal. When I open the map with my desktop pc everything is fine, but when I open it with my HTC Desire and add a marker the map hangs. You can find a demo here (in german) http://park-a-lot.de Just go to "eintragen" and set a marker. Then go hack and click on "...

android not receiving Intent ACTION_PACKAGE_REMOVED in the removed package

When my android app is removed, I would like to also remove files the app has created on the SD card, as these can consume many megabytes and are only of use to my app. It seems that receiving the PACKAGE REMOVED intent would be the place to do this. However, my broadcast receiver is never called--it seems to have been deleted before th...

[Android] reading unicode text from assets

Trying to read an utf-8 encoded file in android... InputStreamReader reader = new InputStreamReader(assets.open("data.txt"), "UTF-8"); BufferedReader br = new BufferedReader(reader); String line; //The line below throws an IOException!! line = br.readLine(); What's wrong with this code? ...

How do I get the thumb of an Android SeekBar to match the height of the SeekBar?

Do I need to implement a custom thumb Drawable? ...

onClick inside ListActivity using SimpleCursorAdapter

Hey guys, I've got a class that creates a list from a DB using SimpleCursorAdapter. I want to add an onClick event to each item in the list but I don't know where to place the code. Any help? ...

Eclipse and Android development - a few noob questions

I've tested deployment to Android Market already as a test, seems like everything is hooked up fine - but now getting a little deeper into java and need to figure out how to use the Eclipse IDE. I'm having exceptions, but where can see the exception message?.. it's not showing up in my consoles , not even the java stack trace console w...

how to let a drawable animation in a oval curve path?

how to let a drawable animation in a oval curve path? The TranslateAnimation just can move a drawable in line. Thank you! ...

Background image for wrap_content

Hello, I created a custom background image and wanted to use it as the background for a layout that has height of wrap_content. However, the total height of the contents of within that layout are much less than the height of the background image. When I set it as the background in XML via android:background="@drawable/image", I notice...

Streaming from M3U on Android

I am working with Android OS to try to stream from an M3U. I don't see why this is a big deal on Android, but for some reason it is. The M3U structure is simple, it's essentially a list of URLs to external MP3 files. However, when you click the M3U in the browser, it tries to launch and then tells me that it's an unsupported file type. ...

gridview in custom dialog not working...?

I have tried adding a grid view to a custom dialog. When displaying the dialog it crashes. But when tried displaying the grid view in normal activity it was working.( without dialog ) I took the examples from developer android website.Took grid view and tried to integrate in custom dialog. I used two xml main.xml & category.xml. Here ...

ListView with section header problem

Hi I'm adding section headers for my listView, there are few methods on the web. Since I'm using simpleCursorAdapter to manage my listView, I adopted phil bogle's method. http://thebogles.com/blog/2010/02/section-headers-for-android-listviews/ The error occurred at this part of the code: listAdapter.setViewBinder( new SimpleCursor...

Dynamic Resource Loading Android

Dear all how can I do this: I'm trying to find a way to open resources which name is determined at runtime only. Let me explain in more details I want to have a XML that references a bunch of other XML files in the application apk. for the purpose of explaining lets say the main XML is main.xml and the other XML are file1.xml file2....