android

Clearing Application database

I have an Android application which uses sqlite database to store textual data for a particular user. The data is read/written from/to the database from a service that runs periodically after every n seconds. My requirement is to clear data depending on age. Like, if the file is more than 24 hours old it should be deleted. Checking th...

Android pages Activity or Layout?

My app Consists an intro page with "Start", "About", etc.. I managed to create a functional version of the app by having the "Start" button call a new layout in which a new onclick listener is defined. This doesn't seem clean to me that I@m defining a new onClick listener for each Layout I use and wonder how the correct way would be t...

Renamed packages and now activity cannot be found

So today I had a bright idea to rename my packages, now my android application which I have schedule for release on thursday is not working. I am getting a similar error as follows: Error: Activity class {org.me.androidapplication2/com.albertrosa.DEMO.MainActivity} does not exist. I have modified the manifest to reflect the change: ...

what difference have ListActivity between Activity???

I need to change Activity to ListActivity. But I can't start my project... do ı need change manifest.xml for it?? Or how can I change screen from Activity to ListActivity? Is there any difference to startActivity(new Intent(this, list.class)) ? 10-05 17:34:54.722: ERROR/AndroidRuntime(11550): java.lang.RuntimeException: Unable to star...

[Android] How to check the type of a view widget?

How to get that working: if(findViewById(ResIdWithUnkownType) instanceof Bitmap) { Bitmap bitmap = (Bitmap) findViewById(ResIdWithUnkownType); } else if(findViewById(ResIdWithUnkownType) instanceof ImageView) { ImageView = (ImageView) findViewById(ResIdWithUnkownType); } ...

Android Sharepreferences and array

Hello, I created a weather widget. I store its configuration in sharedpreferences. The widget is updated by a service. I keep the weather information together with forecasts in an array. After the phone is off for the night i find that the array values are gone,maybe the system suspended? the service. Is there a way to store the array in...

Android: Executing code only on first run and every subsequent upgrade

I have some code that generates a "read me" dialog and does some initial directory creation on the sd card, which currently resides in the onCreate method... I would like to segregate this code and have it execute only once, at the apps first run.. and then after all subsequent upgrades. I've noticed that most apps on the market do this,...

how to open gallery via intent without result

Hey guys, I´ve got a small problem im stucked with. I have a kind of an ApplicationLauncher that has to start the build-in gallery. But I dont want to get any result from that gallery... I just want to start it and want my "Launcher" to close after that. What ive tried: Intent intentBrowseFiles = new Intent(Intent.ACTION_GET_CONTEN...

[Android] How to exchange an image in a layer-list by a bitmap?

Here is my Bitmap Bitmap bitmap = BitmapFactory.decodeStream((InputStream) new URL(url).getContent()); //Need some code to access "dynamicItem" and exchange it with my Bitmap And here is my layer list (nothing spectacular). I want to exchange the dynamicItem with my Bitmap. <?xml version="1.0" encoding="utf-8"?> <layer-list ...

Is it possible to use an expandablelistview as a dropdownview for a spinner ?

I have a 2d array of strings. I would like to use a spinner to allow users to select values from the 2nd lvl of the array but I would like to display the selection options in a expandablelistview using the values of the 1st lvl of the array as category headers. Is this possible, can someone point me in the right direction of how this sh...

How can I change the default size (width + height) of the XML layout preview in ADT plugin for Eclipse?

Every time that I want to do a Layout, I'm getting a black layout preview then I can drop stuff on it, that's ok, but how can I change the size of that blank surface (xml). The question came because I set a folder layout-large and then when I add a new layout.xml to that folder it came with the same size, as a layout-normal, so I’ve some...

Android: Whats the easiest way to save small amounts of data?

I have an app that only requires the value of a textview field to be saved... what would be the most simple and efficient way to save such a small amount of data? Creating a database for this seems like overkill. would onSaveInstanceState be sufficient? ...

Android WebView-based browsers not able to access protected resources through Oracle Access Manager (OAM)

We have a website that makes use of OAM for single sign on (form-based authentication). When we submit credentials to WebGate / Access Server the authorization succeeds, however after the authentication is performed, the form action (as configured in the Authentication Scheme - with passthrough:no) returns a server error instead of redir...

ListView separators using a CursorAdapter

I have a ListView which is populated using a CursorAdapter. I'd also like to have some separators in my ListView. I have accomplished this with an ArrayAdapter, but I'm not sure how to accomplish this with a CursorAdapter. Are there any strategies for doing so? Or am I out of luck? ...

Proper method to change EditText contents in OnTextChanged event

This code below causes infinate loop problem (as documented). So how do I set the editText contents? I have a text message app where the EditText says "Type to compose",I want to remove the instructions once a user starts to enter a message. TIA et.addTextChangedListener(new TextWatcher() { public void afterTextChanged(Edit...

Is it possible to use the Google API maps.jar in a console app?

I'm trying to write test harness for part of my Android mapping application. I would like to run the test as a Java console app under Eclipse. The only Google maps class that I require is a GeoPoint. I've included the maps.jar in the build path and imported the com.google.android.maps.GeoPoint so it compiles OK but generates a runtime...

Android Activity Lifecycle: onStart() -> onStop() possible?

In the Android Application Fundamentals it says that after the call to the onStart()-method of the activity lifecycle either the callback method Resume() or onStop() is called. In case of an "normal" Start of an activity the system calls onCreate(), onStart(), onResume(). But does somebody know an example where onStart() - onStop() are ...

Android 2.1 and Ksoap2-Android-assembly-2.4 -- SoapFault Error

I am very new to Android and ksoap2 development. I have been searching on the forums for an answer to my error and still have not found a fix. Hopefully someone will be able to figure how to fix the error. I am calling a Webservice with 10 parameters in my sample android app using the Ksoap2-Android-assembly-2.4 jar library. The erro...

Image Cleanup Libraries

We are building an application that will take in an image from a mobile phone, extract the text and do something with that. Does anyone know of any image clean-up libraries available (open source or not) that can help, specifically to for digital image cleanup and enhancement so we can do something meaningful with the text. This coul...

Android LocationListener polling interval

I have a Service that uses the LocationListener, and it will be running from boot, indefinitely. My question is, how often is too often to listen for location updates? Is 5 minutes a battery killer? What about 1? ...