android

How can you detect if the device is rooted in the app?

On Launch of the application, I want to detect if the device running is rooted. Is there proper way of detecting it? I don't think trying to write a file to '\data' to see if rooted is a good solution. (Since even rooted devices may have that path unprivileged) ...

Java/Android: anonymous local classes vs named classes

I would like to ask what is the good practice on using anonymous classes vs. named inner classes? I am writing an Android application, which includes many UI elements (buttons, text fields, etc). For many of them I need some kind of listeners, so in onCreate of the application I have bunch of quite small anonymous classes like: someBu...

Apache HttpClient 4.1 on Android

Has anyone tried to use a newer version of Apache HttpClient on Android? There's an annoying bug in the HttpClient used by Android and I was wondering if I would run into problems trying to redistribute HttpClient 4.1 with my app. ...

Is matrix concatenation backwards in Android???

I would expect (based on intuition, and the implementation of AffineTransform in Java): a.postConcat(b) -> a = a x b a.preConcat(b) -> a = b x a but according to the android documentation: public boolean preConcat (Matrix other) Preconcats the matrix with the specified matrix. M' = M x other public boolean postConcat (M...

Android TTS Languages

I am playing with the Android TTS engine. I am trying to set it to speak in Spanish from Mexico, rather than from Spain. I have tried several combination's of language code / country code but I have not been able to get anything by Spanish from Spain. Here is my code currently loc = new Locale("es", "MEX"); myTts.setLanguage(loc); say(...

how to get font from the previous activity on current activity on canvas

how to get font from the previous activity on current activity on canvas ...

What broke my Android Development Environment?

Things had been going swimmingly, but as of last night, when I hit a breakpoint in my own code (not Android code--I've found plenty of people looking for answers to that question, and I get why that's not available), I'm presented with "Source Not Found". I can try "Edit Source Lookup Path ..." all I want but to no avail. What might hav...

Android: Leaked IntentReceiver exception is being thrown even though I call unregisterReceiver.

I don't understand why I'm getting this exception when hitting the back button. I have the IntentReceiver registered in the onCreate method and it is supposed to be unregistered in the onPause method. My Log.w() call inside of the onPause method leads me to believe that the unregisterReceiver() method is being called, but I am getting th...

Android ExpandableListView Child Headers

I need to add a header to the top of the expanded children in an ExpandableListView. The same header should appear at the top of all expanded children. I've been trying to do it from the adapter like this: public int getChildrenCount(int groupPosition) { //Add one extra to children size return mGroups.get(groupPosition).size()+1; } ...

Android ProgressBar not animating

I'm drawing a ProgressBar in a custom View (SurfaceView) to it's Canvas, and it's drawn as expected. Except that it's not animating, no matter what I do. My custom view is animated properly, but I cant change the progress of the ProgressBar. I've created the ProgressBar like this: mImageProgressbar = new ProgressBar(context); mImagePro...

Post message on a wall of Facebook in Android

How to post message to Facebook using HTTP in Android? Maybe there are more simple ways? ...

com.motorola.blur.home.ACTION_WIDGET_ADDED causes my AppWidgetProvider to stop responding?

I've created a home screen widget by extending the AppWidgetProvider. It works fine on all phones tested so far except Motorola's Droid 2 from Verizon. It's running Android 2.2. What I noticed is when my widget is first place onto a homescreen it works for about +/- 15 seconds. Then I see the widget receives the action com.motorola.blur....

Thoughts on Adobe AIR for Android?

I may be assigned an Android project, and have minimal experience with Java but a lot of experience with Flash Builder. Does anyone have an opinion on Adobe AIR for Android, which lets you "publish ActionScript projects to run as native applications for the Android OS"? I'm generally wary of cross-compilers, but don't have a desire to ...

How can I set the maximum height on a ListView?

I would like to create a UI where half of the screen is a ListView and the bottom half is another view. Not sure how to specify the maximum height for the ListView. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="...

Developing apps for both iPhone and Android

We have customers asking for apps that can run on both iPhone and Android. I realize this will mean two different development projects, but wonder if anyone has any advice/creative tips on this subject? e.g. Ways to maximize shared resources? NOTE: Realize making the app web-based would be most effective way, but looking for advice on...

Android GeoPoint with lat/long values

I am trying to get a GeoPoint for -23.4456 by 45.44334 What values do I pass into the constructor of the GeoPoint as it take Ints only. ...

Validating self-signed secure certificate, Android.

Hi, I need to validate a self-signed certificate when connecting to a .NET web service using HttpClient. Can anyone redirect me to any resources ? Thanks, Teja. Edit: From what I've learned after posting, the following src code from http://svn.apache.org/repos/asf/httpcomponents/httpclient/branches/4.0.x/httpclient/src/examples/org/a...

Canvas drawline with semi transparent lines overlap problem

I am drawing several lines on a canvas using drawline, the lines are semi transparent (their paint has an alpha value <255) only problem is that the point at which they cross creates a dot of less transparent color (obviously) is there a simple way to avoid this? ...

How to remove static variable value ,when will i close my activity

Hi Friends, i want to clear variable value when will i close activity Thanks All ...

adding to the middle of an empty ArrayList?

if I create a new arraylist of size 5... Player P; ArrayList<Player> orderedPlayers = new ArrayList<Player>(5); and then I try to add to the middle of that arraylist... orderedPlayers.add(2, P); I get an indexoutofbounds... I also get indexoutofbounds if I use set instead of add... orderedPlayers.set(2, P); in fa...