android

Should I compile my Android apps against the latest SDK?

My app requires that devices are running at least Android 2.0 OS. Would it make more sense for me to compile my project with the 2.0 SDK or does it make more sense to always compile my project using the latest SDK, even if it's well beyond 2.0...? The problem with compiling against 2.1 for example would be that I don't know if an Androi...

How to prevent incoming SMS from reaching the inbox?

I'm working on a simple app that receives, but not handles sms messages. It checks each incoming sms for a specific keyphrase. If the sms contains that keyphrase then it responds accordingly. If the keyphrase doesn't exist, then my app does nothing. I have this much working. I was wondering if there was a way to prevent the default s...

LinearLayout Center

I've a little problem with alignement in LinearLayout. I'm trying to have the frist two elements with left alignement, and the third at the center of the screen. Here is my code (cleaned from id, text, src) : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:ori...

how to reach the sub activity code in debug mode.

I have a activity B that is called by activity A, I want to debug the code in B. I have set the breakpoint, however the debug control never enters B. public class A extends Activity { Intent j = new Intent(mContext, B.class); startActivity(j); } -- public class B extends Activity { some code --Break Po...

How to cancel this repeating alarm?

Hi, I'm writing something like a reminder for users. Users will set reminders for their events, when the time comes, a repeating alarm will be set to trigger a status bar notification. But the alarm seems non-stop after I selected the notification or cleared the notification. I am not sure where to cancel this repeating alarm. Below are ...

Customized Search in Android RuntimeException can't set breakpoints

I am trying to implement my own Search using searchable, and as soon as press return after entering a query into my custom search field, I get a RuntimeException: Thread [<1> main] (Suspended (exception RuntimeException)) ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2585 ActivityThread.handleLaun...

OpenID for android apps that require SignIn

Hey out there! I am a fresh developer on Googles Android Platform - my HTC Desire arrived last week. Now i need a way to sign in to my existing application (Java, currently running on jetty). The server Application is developed using spring security 3.0.2 In my case, i want to support the following: If a user has set up his Android ph...

RemoteViews setLayoutParams?

Hi, I would like to set the height of a TextView to WRAP_CONTENT remotely. How would I do that, since there is no remoteviews.setLayoutParams(viewId, param) function? I tried remoteviews.setInt.(viewId, "setHeight", -2), but that just sets the height of the TextView to zero... Thanks! ...

iPhone- like tab bar in Android ?

In iPhone we can create a view that has a tab bar and make it the root view of the application then use the tab bar to navigate through sub views. what is the most close approach to this in Android? Is it to use a Tabbed Control? but this includes using just one activity. what is the approach to use in Android to create an activity wi...

PhoneGap navigator.notification.beep method repeating, failing

I have a functional Android/PhoneGap application that is able to use notification.vibrate(duration) and notification.alert(message, title, button) successfully, however, when I access PhoneGap's notification.beep(times) method, the beeping infinitely repeats for the lifetime of the application: navigator.notification.beep(1); This fol...

android png optimization

I have an app that using alot of .png fils, so to reduce app size I used PngOptimizer to optimze them. I was happy with the results and the file size of the png's went from alittle over 1mb to 300kb or so. but for some reason the app size only went down about about 100kb. doesn anyone know why? I would really like the file size reduc...

Is it "reflection" when I use getClass.getMethod(...)?

I've written a few bluetooth apps now, but I had never seen this particular approach until recently. In the example they use device.getClass().getMethod("createRfcommSocket", new Class[] { int.class }); which seems to me a long way of just saying BluetoothSocket bs = createRfcommSocket(.... What is the difference between their approach...

Android: Resize a large bitmap file to scaled output file.

I have a large bitmap (say 3888x2592) in a file. Now, I want to resize that bitmap to 800x533 and save it to another file. I normally would scale the bitmap by calling Bitmap.createBitmap method but it needs a source bitmap as the first argument, which I can't provide because loading the original image into a Bitmap object would of cours...

Android: Widget does not load content on creation

Hello to all, I decided to create my first Android widget this weekend and although I have gotten it to work somewhat, it does not display the dynamically-loaded content until I rotate the device (using Launcher Pro Plus which allows landscape orientation and rotation of home screens). The widget is pretty simple, it just retrieves an ...

Java Queue, Arrays, and JNI

I think this is a general Java question, but it does involve some Android stuff. So here's the deal: I've got a JNI wrapped version of MPG123 for Android, and I can pull PCM data from an MP3 file on the SDCard. I'd like to pull a chunk this data, do an analysis on it using another class I wrote, then push it into a queue. Ideally, I'd...

Android handling server messages through threads

Hi, I want to be able to handle input from a server through a Socket and pass it to a method to process it. I am trying to implement this through a class that implements runnable, with a loop in the run statement such as: public void run() { while(notDisconnected) { line = readLineFromServer(); if (!(line...

Using clipRect - explantion

import android.app.Activity; import android.os.Bundle; import android.view.View; import android.graphics.Canvas; public class POCII extends Activity { myView mv = new myView(this); /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...

No data appearing in ListView, using SimpleCursorAdapter

With the below code, nothing appears in the ListActivity as I would expect. No errors are shown in logcat. Arrival.java package one.two; import java.io.IOException; import java.util.ArrayList; import java.util.List; import android.app.ListActivity; import android.database.Cursor; import android.os.Bundle; import android.widget.ArrayA...

Kindle - best way to save images

I have created a book that each page is a JPG picture (believe me, this is how the book is intended to be). This book is intended to be read in landscape. This will be a kindle book, intended to be read on all kindle platorms (kindle 1, kindle 2, iphone, ipad, mac, windows and android). I don't have a kindle yet, but I have kindle app ...

ExpandableLists - nullpointer exception When array contains a null value

Hello Gurus, I am using a simple expandable list that is populated by two arrays ( group array for the groups and a multi dimensional children array for the child). The arrays are built dynamically in the program and some group items have more children than others. So I end up defining the highest number as the array size for the multid...