android

How do I center a GridView in its LinearLayout parent ?

GridView is not behaving like it is supposed to. This screenshot shows that the GridView (in landscape mode) is flushed left. I want it centered. This is the XML layout for the GridView. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/templatelandscape" android:orientation="horizontal" ...

Android: Is it possible to have different handlers for drawableLeft and the text inside a TextView?

I was wondering if it is possible to have different behavior depending on a click on the icon and the text inside a TextView... Any suggestions? ...

Android and data storage space?

Hi Im wondering how much data storage is available for my application in android? I need to cache lots of files, and i was thinking to store it inside the sharedpreferences, this way it gets deleted if the application is uninstalled. Afterall its just alot of cache files. I guess i could also use the SDCard, but than i dont have any co...

How to find out who the ROM provider is?

I have an automatic bug reporting facility in my app that includes useful information for debugging. One thing that I would like to include is the ROM provider. In particular I would like to know if the user is running a custom ROM and which, preferably even with the version number. Any idea how to retrieve this information programmat...

Faster Android development

I have noted that in my computer Android and Eclipse are very slow. I agree that my computer has not very much memory but I was wondering is there any lightweight version of the emulator and is there some lighter IDE than Eclipse which supports Android development and Android debugger? ...

Using sqlite db created in Windows but to be accessed in Android

I already have a sqlite3 db file that I created in Windows, is there a way to package this file into my android application and access it as a sqlite db from within the application or do I have to create a db on application load or something in Android only? The db has about a 1000 records, writing sql scripts again might be monotonous a...

How to create a Bottom-Top animation when close/stop an activity in android

How can I create a Slide-Bottom-To-Top animation when close/stop an activity in android application? ...

android: problem with Serializable object put into intent

Hi i have problem with a class i want to pass in an intent by putting it into the putExtras() Its serializable and the code looks like this: public abstract class ObjectA extends ArrayList<ObjectA> implements java.io.Serializable{...} public class ObjectB extends ObjectA {...} ... Bundle extras = new Bundle(); extras.putSerializable(...

Voice recognition and localization?

Does anyone have experience with java voice recognition and localization? I'm thinking to build an android application, with some basic voice recognition options, but I want to implement localization for that based on some translate tool, maybe Google translate, and users can update his "dictionary" with new languages from remote dicti...

Detecting scroll position inside a ListView (or ScrollView)

I'm building a chat room application where new events are being polled for every X seconds. Every time that happens, this code updates the RoomAdapter (a custom subclass of ArrayAdapter) with the new data and scrolls it to the bottom: RoomAdapter adapter = (RoomAdapter) getListAdapter(); for (int i=0; i<newEvents.size(); i++) adapter...

how to connect emulator to server in android application

I am developing an application in android to connect emulator to server and then read, edit and write on it. Has any one worked on such application please let me know. Else guide how to develop this application. I am using Socket in my application. i am able to run the code when my machine is server and client but not able to do when c...

Android Image Viewer from App

I'm trying to launch an image which is written to my application directory with the builtin Android image viewer. This image has been written in a different part of the app to the app directory. When getting the following file: super.getFilesDir() + "/current.png" File.exists() returns true. How can i launch the builtin Android image ...

Receiving SMS messages in Android 1.6

Hello all. I have a code sample (from Reto Meier's book) on receiving SMS messages in an android application using a broadcast receiver. I am looking to be able to receive a SMS message in my application however the code I already have a sample of seems to be depreciated from what I can tell... Does anyone have a more up to date (andr...

Manually set width of spinner dropdown list in android

Is it possible to set the width of a spinner dropdown list in code? I have a spinner populated with integers, and it does not look good with the list expanding to full width. Can I set the width to wrap the content somehow? Spinner hSpinner = (Spinner) timerView.findViewById(R.id.timer_hour_spinner); ArrayList<Integer> hList = new Array...

Android application configuration

Where should I store my Android application's configuration settings? Coming from the .NET world I was expecting something like .config. Do I create a file under res/values, and use that? ...

Navigation into GridView does not trigger OnItemSelectedListener

I have a layout that looks like this (some attributes removed for brevity) <RelativeLayout> <ImageButton android:id="@+id/button" android:nextFocusRight="@+id/gridview"/> <GridView android:id="@+id/gridview" /> </RelativeLayout> When I navigate using the DPAD from the button to the gridview, the On...

Sqlite Closable excpetion Android

Hi , I am getting SQLite closable exception I am calling deactivate and close on cursor still i am getting the same exception . can any one tell me what i am doing wrong? ...

slow android emulator

I have a 2.67GHz Celeron Processor, 1.21GBs of RAM on a x86 Windows XP Pro machine. My understanding is that the emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very ...

AsyncTask in OnCreate fails at runtime, how can this be avoided in Android?

Hi I have an activity that starts with an AsyncTask to check the connection to my servers api. Since this should not run in the UI thread i have made a AsyncTask for this. The problem is that is get an runtime exception when i start the background process of the Asynctask. How can i avoid this? From log: 10-12 14:18:56.476: ERROR/An...

Stop EditText from gaining focus at Activity startup?

I have an android activity, with two elements: EditText ListView when my activity starts, the EditText immediately has input focus (flashing cursor). I don't want any control to have input focus at startup. I tried: EditText.setSelected(false); no luck. How can I convince the EditText to not select itself when the Activity starts?...