android

how to use getLastModified() in android for XML file creation/modicfication date check

hi, I am parsing XML file in my android application, but I like to modify the code, that it only parses the XML file if it is update (I will store the last successful parse date). I found out the urlConnection.getLastModified(); but not getting proper idea of how to use it, as it is returning milliseconds as long. is it possible I c...

Android: Device Compatibility

I program and test using the Droid Incredible. The other day my friend downloaded my alpha version, which works flawlessy on the Incredible, but crashed on his Moto Droid. I just updated my app to use 2.1 api's instead of 1.6; maybe this will make a difference? I upped my min version requirements to 7. My question is how can you make s...

Android Edittext question, replace keypad enter with done.

Hi Guys, I'm defining an edit text like so... <EditText android:id="@+id/user" android:layout_width="200px" android:layout_height="wrap_content" android:text="Username" android:textSize="18sp" android:gravity="center" android:layout_x="64px" android:layout_y="140px" > I'd like to replace the "enter" button that appears on the keypad...

How to retrieve dialled and received call details ?

Hello Frnds, I would like to save both dialed and received calls details into database. Can anyone please help me out with this ? Regards, Serenity. ...

ksoap2 android sending data

Hello everyone I'm trying to get ksoap2 working on android. I have spent at least 10 hours now reading forum posts, and documentations. Just querying some methods like getServerTime where I don't have to send any values, works. My goal is to send data, and receive a response. For example: send city name, get city time. I'm practicing o...

Is there a raw file size limit for android?

Can someone tell me if it is possible to put an archive file with a size greater than 1 mb in res/raw and at runtime copy it to sdcard and decompress it? ...

How do I get rid of the Chinese and Japanese characters on my AVD 2.1/2.2 Keyboard?

Can anyone tell me how to change the Language & Keyboard start-up settings? ...

Designate an arbitrary folder as Android assets?

It seems that the Android resource compiler does not take into account linked folders (in Eclipse sense) in the assets folder. Question - is there a way to forcibly designate a folder of my choice as Android project assets? Short of copying or hardlinking into project assets, I mean. ...

Android SQLite Cursor out of bounds exception on SELECT count(*) FROM table

Hi guys, The following function is giving me an out of bounds exception... public void count(){ SQLiteDatabase db = table.getWritableDatabase(); String count = "SELECT count(*) FROM table"; Cursor mcursor = db.rawQuery(count, null); int icount = mcursor.getInt(0); System.out.println("NUMBER IN DB: " + icount); } I...

how to include a view created in a xml file on my main layout

Hi I want to create a grid of images with text right below the images. I created in a xml file a image_text item which basically is a linearlayout with and imageview and a textview right below. I created a tablelayout and I want to add my custom image_text.xml to the table row. But I dont know how to reference my xml file inside. If ...

Delete all rows from a table, throws nullpointer

Hi Guys, I'm trying to write a function that will delete every row in a given table but I'm getting a null pointer exception. Could somebody point me in the right direction? Here is the code... public void deleteall(){ SQLiteDatabase db = tweets.getWritableDatabase(); String delete = "TRUNCATE FROM tweets"; db.rawQuery(d...

Https request, authentication in Android

Hello, I am currently trying to authenticate with a server via a http Get call. The code provided below works when compiled in a java project. Returning the correct token to the program. However whenever I try to implement the same code in Android I do not get a token returned via the Get call. In Android I am returning inputLine in a ...

Problem with ExpandableListView position

I have a "Dynamic" ExpandableListView. That is to say child are only load when there is click on there parent. So I use onGroupExpand to load list. It works but I must expand myself the group with expandableList.expandGroup(groupPosition); The problem is that, when I click on parent, the group expands but the view go back to the ...

Sharing a context menu between Activities

I have two activities that both contain an identical context menu built programmatically using menu.add(int, int, int, CharSequence). They both use onCreateContextMenu and onContextItemSelected. The first Activity contains a ListView, when the user long presses on an item the context menu appears for that item. The second Activity (a ...

Create image from view/screen in Android

Is it possible to create a bitmap image from a view or the screen in Android? ...

how to restart a thread in android?

hi there! in my android app i have an ui-update-thread that keeps all my views up-to-date. protected Thread UIUpdateThread = new Thread() { @Override public void run() { while(true) { query_some_data_from_service(); // gets some "fresh" data from a service UIUpdateHandler.sendEmptyMessage(0); // will update all ui eleme...

Android exception handling, program halts....

I'm trying to catch a login exception thrown by the class that readerAccount belongs to in the code below. while(!readerAccount.isAuthenticated()) { try { readerAccount.login(); } catch(AuthenticationException e) { cmDialog.show(); Toast.makeText(this.mCtx, "login failed", Toast.LENGTH_SHORT).show(); ...

How to connect with udp in android?

Hi all.I am new to android.I need to know how to connect (communicate) with PC’s UDP server with android client.Can anyone give a simple example ( Guide me to understand) ...

Works on emulator, not on phone

This code: public void onSurfaceChanged(GL10 gl, int w, int h) { gl.glViewport(0, 0, w, h);// gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); gl.glMatrixMode(GL10.GL_MODELVIEW); gl.glLoadIdentity(); // set camera zoom GLU.gluPerspective(gl, 45.0f,(float) w / h, 0.1f, 100.0f); // point camera GLU.gluLookAt(gl, 0, 1, 5, 0f...

how to i edit contents of TextViews in Android Dialogs?

i want to display a dialog in my android application where certain TextViews in the layout need to have content set during runtime. while showing the dialog itself is no problem at all, accessing the TextViews via TextView.setText(String) crashes the application. this is what i got so far: dialog = new Dialog(this); dialog.setContent...