android

Android - Simple View Refresh

Hi there, I don't think my future lies in Android development, as I am consistently failing at the simplest things... I've got a button with the label "Game Slot 1". When the user clicks it, I succesfully take them through a couple of activities in which they create a new character. I save the game name in an SQLite database, and the...

can one prevent the Android device emulator from popping up the onscreen keyboard?

I am developing an Android application. What I find most annoying during testing is, that the emulator always pops up that on-screen telephone keyboard whenever I click into a text input field. Since I input my data with the keyboard anyway I find that most annoying. Can one switch that on-screen keyboard appearance off? Or can one chang...

Android viewflipper flicker

I have a ViewFlipper with multiple views added dynamically. I override onTouchEvent (and onInterceptTouchEvent) in order to get the down, move and up events on the views, so I know when to animate left and right. Now everything works fine, except that there is a small flicker (one of the other views is displayed on top for a split secon...

Alert Builder is only called first time?

I have implemented the following function to be used with showDialog() and onDialogCreate(), but I would like the method to be called each time because it calculates the text of a text view every time the dialog is displayed. private AlertDialog overallScoreDialog(){ AlertDialog.Builder alert = new AlertDialog.Builder(this); Con...

Selectable width of list items in ListActivity

In an Android project I am working on I have a ListActivity that is set up like this: public class myClass extends ListActivity { public void onCreate(Bundle savedInstanceState) { ... String[] menuItems = new String[] { "View", "Share", "Delete" }; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, ...

Android: addView and layout method does not work together.

In Android when I am adding a view object like ImageView to FrameLayout view and then immediately trying to call layout() method to repositioned the added view object it is not working. But when I call the layout method alone after some new event e.g. touch event then layout() seems to work. This also happens when bringToFront() and layo...

SQLite - inserting a string with newlines into database from csv file

All, I am trying to inject a long text entry into a SQLite database, in a TEXT field. This text has new lines in it (i.e. it spans multiple paragraphs). I can get the new lines to show up if I do the INSERT manually: INSERT INTO "LOGENTRY" VALUES(5,40,'PLACE','line1 line2 line4 ',1283990533315,'4A','TEXT','',NULL); but if I have ...

download apk from own Webserver

Hi, I am having problem with download my android application from my own web server. First I sent a html content with java script to ask Android phone to open my download link <html> <head> <script> window.onload=function() {{ window.location = "downloadURL"; }} <...

Create "Battery usage" intent android

On my nexus one, there is a handy app reachable from Settings > About Phone > Battery use. I'd like to StartActivity() that app from one of my Activities. I can see in the log that when Settings runs it, this intent is logged: Starting activity: Intent { act=android.intent.action.MAIN cmp=com.android.settings/.fuelgauge.P...

How to prevent options Menu "More" Button from getting localized on android?

The options menu's "More" button gets localized automatically, while the rest of the app isn't localized. The "More" button changes to "Mas" because the I picked "espanol" as my language. How do I prevent the "More" button from getting localized? ...

2D Tile System not behaving properly

Hello and Welcome I am trying to make a 2-D tile system heavily based off of the Snake example. The original mTileGrid is still there, but there is a new array: mMapGrid. The point is to copy the data from mMapGrid to mTileGrid on each update cycle and therefore simulate an area larger than the immediate screen. I wrote more functions...

Android views as templates

Hi, I want to create an android Layout of which I want to instantiate several copies. I understand that declaring the layout in an XML will create a single instance. Is there a way to use the XML View declaration as a 'definition' rather than a 'declaration' ? Or is it possible to clone a view ? Thanks; ...

How to add a different type of item in the ListView using SimpleAdapter?

I want to add a different type of item (like a simple textview) to the last position in my ListView. I extends the SimpleAdapter and override some methods: @Override public int getCount() { if (super.getCount() == 0) { return 0; } else { return super.getCount() + 1; } } @Override public Object getItem(int p...

Offset shape within a ShapeDrawable

I'm trying to draw a rounded rectangle with a border around it using a class that extends ShapeDrawable (see here) and everything is working except that the shapedrawable seems to be cutting off some of the border because the shape itself doesn't extend outside those bounds. Is there not some way to offset where the shapedrawable start...

Dynamically java class on android/dalvik?

I use DexClassLoader load my update class files is ok. I println class methos values,I find method values don't update class method value,Is old class method values why? ...

Android: Possible to preserve data when upgrading app?

Is it possible to preserve file-persisted data when upgrading an app? For example my app stores data under /data/data/mypkg/store. I would like the store directory to be preserved when user upgrades my app. ...

android manifest build number

I was wondering if it is possible to have Eclipse automatically increment the build version number inside of the Manifest each time that I either build or run an Android app. Has anyone ever done something like this? ...

Finding Android source code

Are the Android APIs open source? If so, I want to see how they implemented the smoothscroll method for the ListView object (this is implemented in API level 8, but I want to build against an earlier API level). How would I go about finding this? ...

Can this be done: Variable number of radio buttons in a radio group inside a table?

I currently have code that creates rows in a table that hold a string in column 1 with a RadioButton in column 2. There can be a variable number of these rows. That all works just great, but I want to add them to a RadioGroup so only one button can be toggled at a time. When I tried to add the dynamic RadioButton to the RadioGroup AFT...

Launch widget from code

Hi, Is there any way we can launch the widget from our application immediately without user have to choose the widget. So it like automatically add widget to our home screen using code. Thanks. ...