android

App crashes when switching to landscape layout

I am having trouble setting up landscape mode in my application. I have a /res folder that contains a layout folder and a layout-land folder layout -----main.xml layout-land -----main.xml My /layout-land/main.xml contains different UI elements than /layout/main.xml. How can I map each layout appropriately when the user has switched ...

Can we pass singleton class's object via intent?

Can I pass a singleton class's object from one activity to another activity using intent? I am using singleton class as imageclass img = imageclass.getInstance();, so i need the img instance for another activity, how can i pass an object instance in Android? Thanks all ...

Undefined error when trying to run android tutorial Form stuff

Hi all, I have copied and pasted the code from the Form stuff example on this website. I am getting an error when i try and run the project, the project has a little red square with a white cross on it but when drilling down into the elements of the project (using eclipse) there is element with an error. In the problems tab of eclipse...

How to display log message when an activity is started in Android

Hi, I am in one activity say Activity A. I am calling another activity B. In activity A I write the following Statement: startActivity(new Intent(this,ActivityB.class)); Now, I want to log a debug message only when Activity A is able to successfully launch ActivityB. How can I achieve this feature in Android. Any kind of Help is appr...

Android Ellipsize marquee issues with currently selected list item

My Question - I want the text of a TextView I have in a custom ListView to marquee scroll ONLY when the item is selected in the ListView. When the list item loses focus, I want the marquee to stop scrolling. I know that I need to set the TextView to enabled (setEnabled(true)) for scrolling to work however when I do this as items are adde...

Android TextView text not updating during runtime

Hello, I've got to missing something completely stupid on this one since updating a TextView should be an easy task. I have an Activity class that is an observer of another that receives messages. In my Activity's onCreate I do the following and it works fine. theStatus = (TextView) findViewById(R.id.theStatus); theStatus.setText("w...

FFMPEG libx264 2-pass for smartphones

I use the following ffmpeg command to convert a video for smartphones. It works for Droid x and Iphone4, but not windows media player nor the older version of droid. Can anyone shred some light? Those droids works with Youtube h264 codec. But somehow doesn't play the video of my encoded mp4 (the audio plays just fine). ffmpeg -y -i ...

Android intent-filter pathPattern numeric matching

I'm adding an intent filter to my android application and I want it to catch requests that go http://www.somedomain.com/[numericValue] . I only want to catch it if the path is numeric, but if it has text, I don't care about it. I tried the pathPattern of [0123456789]*, but that didn't work. Is this possible to do? ...

Why isn't there a remove(int position) method in Android's JSONArray?

I started building an Android app that uses a flat file for storage. The app doesn't store more than six records, and I'm familiar with JSON, so I just write out a JSONArray to the file. I just discovered today, though, that the Android JSON API doesn't include a remove() option. Huh? Do I have to dump the array into another collecti...

What are some of the best ways to get your Android application noticed after it leaves the 'Just In' section?

So I've recently released an application on to the Android Market. Whilst it was in the "Just In" section I was seeing decent download numbers, but since then interest seems to have dropped off significantly. I think now people can only find my app through a specific keyword search, which doesn't make me particularly confident about it e...

How to create highly themed Android applications?

I'm wondering how the UI of e.g. Opera Mini, Adobe Reader or the new Twitter application is made on Android. Both of them use very different looking controls than what the OS provide in default. Are they using the platform's theming method to create these or a canvas and draw everything byself on top of that or maybe completly "from scra...

Proper implementation of changing ListView data with CursorAdapter

I have a ListView populated via a CursorAdapter. I give my user the ability to alter the data in the list. For example, the user can mark a row as being unread (the data are messages). Suppose my user marked a row unread. Would a proper implementation mark the row in the database as read and then requery the Cursor? ...

Application dedicated Android Device is it possible?

I have been tasked with sourcing an off the shelf touch pad device that can be used as a dedicated industrial instrument controller. Is it possible to run a dedicated application and prevent user access to all other functions/applications within Android. Also is it possible write your own USB device driver which would allow you to conne...

Alternativ to GM_xmlhttpRequest?

Hi, I (as a complete JS newbie) am trying to port a Greasemonkey script to Android. The only problem so far seems to be the call to GM_xmlhttpRequest or XMLHttpRequest (the script tries to use one of them according to the browser it detects). Is there any known alternative API on the android browser? Thank you in advance! ...

Static variables in Android

I defined static variables in Activities in order to pass complex data between Activities. Many people suggest not to use any static variables in Android. Some people suggest to store global data in a custom android.app.Application. I don't think there is any difference between static variable and custom Application. I'd like to know y...

instance-specific AppWidget configuration

Say that there is an App Widget that shows a configuration Activity when placed. The configuration page allows adjusting the appearance of the widget. The user may place multiple instances of this widget on their home screen. What would be the best way to maintain the unique configuration states on each of the widget instances? Or woul...

Motionevent.getX and getY

I need help understanding the following. Say I have a display that is 854x480 pixels. Why is it that the MotionEvent.getX and getY methods return floats? As far as I can tell, the pixels on the display are discrete integers, there is no such thing as a half a pixel on the display. ...

Bug in minSdkVersion or what?

Hi guys, I've just published my app on the android market but something weird happened, this is not my first time publishing an app so I'm almost sure I'm not doing anything wrong here, so would like to know if anyone had this same issue before. 1st Attempt: Manifest.xml file <supports-screens android:largeScreens="true" android:norm...

Store BLOB in Android's SQLite using SQLOpenHelper

Is there a way to store a BLOB into Android's SQLite using SQLOpenHelper? My BLOB of type InputStream. ...

How can you localize drawable-nodpi?

The documentation seems to imply you can't do localization AND resolution targetting. Can anyone tell me how you can go about localizing drawable-nodpi? Eclipse returns an invalid resource directory name error. I'm targeting Android 2.2 only so if there are more recent ways to solve this, would be great to hear about them. ...