android

how to set custom title bar TextView Value dynamically in android?

friends, i have created custom title bar using following titlebar.xml file with code <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/myTitle" android:text="This is my new title" android:layout_width="fill_parent" android:layout_height="fill_par...

Dynamically added views in linearlayout

dynamically i am creating the linear layout and adding the views to linear layout every 5 sec i need to update data to linear layout from db when i check logger output it is adding to linear layout but gui it is not updating for every 5 sec updation i am using scheduleatfixed timer task ...

Adding view to bottom of layout inside a scrollview

So my layout looks basically like this: <ScrollView> <RelativeLayout> <BunchOfViews/> <ImageView android:layout_alignParentBottom="true"/> </RelativeLayout> </ScrollView> I have the ScrollView so all of the layout always is visible no matter the height of the screen. The problem is that on a very high screen, I...

InvocationTargetException on inflating an xml - android

Hi I have a code that works 99% of the time since is deploy in lots of clients, but sometimes I get the following: java.lang.reflect.InvocationTargetException android.widget.LinearLayout.(LinearLayout.java:92) java.lang.reflect.Constructor.constructNative(Native Method) java.lang.reflect.Constructor.newInstance(Const...

Changing the Android emulator locale automatically

For automated testing (using Hudson) I have a script that generates a bunch of emulators for many combinations of Android OS version, screen resolution, screen density and language. This works fine, except for the language part. I need to find a way to change the Android system locale automatically. Here's some approaches I can think o...

Android: bug in launchMode="singleTask"? -> activity stack not preserved

My main activity A has as set android:launchMode="singleTask" in the manifest. Now, whenever I start another activity from there, e.g. B and press the HOME BUTTON on the phone to return to the home screen and then again go back to my app, either via pressing the app's button or pressing the HOME BUTTONlong to show my most recent apps it ...

What settings can my app control to conserve battery life?

I was wondering what settings an application can control to improve battery life in the Android environment. On most laptops, you can control screen brightness, wireless adapter settings, etc, as a means to conserve battery life. Are there any such controls in Android? Thanks! ...

Get a list of nearest business

Hi, I am trying to use MapView and I want to show in the map some points of interest (like restaurants or stores) near my location. Is there a way in the api to get this kind of list? I know I can do this manually, but first I would need to get the geolocations. So which would be the best way to do this? ...

how to get end of file(EOF)

I have this code.. String you = buf.readLine(); Log.d("STRING", ikaw); StringTokenizer st = new StringTokenizer(you); double lat = Double.parseDouble(st.nextToken()); double lng = Double.parseDouble(st.nextToken()); int type = Integer.parseInt(st.nextToken()); ...

Android Animation for all the items in a list

Hi, i have a listView which uses a custom .xml for showing each item. Fine, in this xml i have a CheckBox (with visibility set GONE) and a TextView with a text. What i want is have an animation which moves the text to the right and shows the CheckBox. I have the animation working fine for one item, but if i want to start it for all t...

3D Carousel for Android?

Does anyone know how to implement a 3D Carousel selector? Something like this: ...

Android: Forcing a MapView to redraw

I've found that after changing the overlays on a MapView, the changes aren't seen until the user moves the Map, causing a redraw. Is there a way to force this redraw? ...

How do I create a ListView that's not in a ScrollView, or has the ScrollView disabled?

I want some of the goodies in a ListView, like being able to use a ListAdapter, and item selection, etc, but I don't want the ScrollView portion of it. I want to implement that part myself, in a different way (why or how I do this isn't really the point of this question, so please don't ask "why"). Is there a way to have a ListView tha...

Does anyone know if Google plans to release an Earth API on Android?

Now that Google Earth has been released for Android 2.1, does anyone know what, if any, plans there are to extend the Google API's to support it in a future version? ...

Alternatives to Java for Android development?

Hey all, I've started developing Android apps a couple of months ago, and have a few under my belt. While I can tolerate Java enough to keep developing, I was wondering what success the community has had getting other languages to run. I've done some investigation as to how other JVM languages work, and it appears Dalvik messes them u...

Sending SMS programmatically in 1.5 on CDMA device

I am developing an application that relies heavily on sending SMS programmatically. I followed the examples released after 1.6 that demonstrate how to use an abstract class to implement sending for 1.5 and 1.6+. I started getting complaints from some users about how it appears as though SMS should be sent but they are in fact not. It to...

throws SecurityException when signing with the default debug keystore

I am receiving a SecurityException since yesterday when I launch the service using signature protection level for permission with the default debug keystore. The strange thing is I wasn't receiving this error before yesterday and I didn't make any security related change. On the other hand, my own keystore using for releases is still wo...

Android numeric password field

I have an EditText field which needs to be a numeric password field. Everything works OK in portrait mode; not in landscape. When the user selects the EditText field, the UI zooms into the field and when I type all the characters are visible. I need a numeric keyboard also. I tried setting the input type to text password|number. If I re...

milliseconds to UNIX timestamp

Hello, Anyone have any idea how I would go about converting a timestamp in milliseconds from 1970 (from android's System.currentTimeMillis();) to a UNIX timestamp? It need only be accurate to the day. I figure I could divide by 1000 to get seconds, and then divide by 86 400 (number of seconds in a day) to get the # of days. But I'm not...

How can I override the canvas in my View?

I am using Android 2.1 and Eclipse. I have defined a LinearLayout with two components that have dimensions: 250 x 250. LinearLayout ll = new LinearLayout(this); ll.setOrientation(LinearLayout.VERTICAL); LinearLayout.LayoutParams llp = new llp.LayoutParams(250, 250); meter1View = new MeterView(this, "Meter 1"); ll.addView(meter1Vie...