android

Shape glass effect

Hi, I've created a custom toolbar using a gradient inside a shape. It looks very nice, but since we only have the option for 3 colors (startColor, centerColor, endColor) it looks very round. I would like to do a glass effect, which requires a sharp change in color in the middle. Basically I need 4 colors (startColor, justabovecenterC...

How to unpair bluetooth device using android 2.1 sdk

In Android 2.1, to unpair a bluetooth device you can go to Bluetooth settings, long-click on a device and select Unpair to unpair that device. I want to be able to do this from my application. I can retrieve a list of paired/bonded devices using BluetoothAdapter.getBondedDevices(), but I can't find how to unpair. I've explored the Blueto...

Problems with Android SDK and Eclipse (Windows 7 32bit)

Hi , before posting I have searching around this forum and the web on one of my problems the Java build path error. Currently I am going through a Sams learn Android SDK in 24 hours book and cannot get past the first hour!!!! because of the problems As I mentioned before, I have read all suggestions I could find on the gen folder erro...

Android : Receive custom broadcast when a button in a widget is clicked

I have a BroadcastReceiver that works fine, i.e. executing this code from an Activity, the receiver receives the intent: Intent toggleIntent = new Intent(this, ToggleServicesReceiver.class); this.sendBroadcast(toggleIntent); But I am trying to do the same from a button in a Widget: public void onUpdate(Context context, AppWidgetManag...

Android: Design option for grid of buttons?

I need to design a grid of 2x30 buttons on the screen with labels of names. What's the best layout-way to create the 2 groups of buttons given the button info/color/title will be populated from a database. I was thinking a TableLayout perhaps, then in code create the buttons and add them to cells? ...

How does one launch android version dependent alarm clock?

I have a widget that displays the time and if one taps on it, it launches the com.android.alarmclock/.AlarmClock activity with an PendingIntent. This works great before-Froyo, but with Froyo, I have to launch the com.android.deskclock/.AlarmClock. So I want to put in code that checks for the class existence and launch the appropriate a...

How to display Custom message before force close or ANR message will occur

Hi all, How i can display custom error message before foreclose or Application not responding message will happen for an application. Or Can i display Custom message like "Please wait....." instead of Application not responding message. Thank you ...

Can I update data members in one Activity from another Activity in the application?

I've tried this and it works, but I didn't know if this was a bad thing or not, as all the help on data transfers between Activities seems to use intents. In MainActivity I have: static PilotRecord pilotRecord = new PilotRecord(); //PilotRecord just contains data item declarations In MainActivity.onCreate: pilotRecord.fuel = 100; ...

MapView inside ScrollView doesn't show zoom controls

Hi everyone, I put a MapView inside a ScrollView. Also, I added zoom control to the map view mapView.setBuiltInZoomControls(true); The ScrollView scrolls correctly, but when I click on the MapView, the zoom controls is not displayed. (for most of the time). Normally, the zoom control should show at botton of map view. It seems And...

Remove notification when force close message occured

Hi all, Im displaying a notification when app running. For any reason app showed force close message, which closes the app after clicking the force close button, I need to remove the app icon from notification area. Please guide me hw i can do this. ...

Android notification and ringer volumes, a question...

The Android phones have a setting that allows you to force the notification volume to match the ringer volume, I can't seem to find that setting anywhere in SDK, can someone help me find out how to get and set it that specific setting? ...

Inconsistent results connecting to a specific Wifi Access Point

Hello, I'm working in an application that (among other things) will connect to an specific device that is acting as an open Wifi Access Point and send some configuration commands to it. I'm currently creating the configuration for the network: WifiConfiguration config = new WifiConfiguration(); config.BSSID = bssid; config.priority= 4...

froyo apps2sd, can a widget go app2sd

froyo apps2sd, can a widget go app2sd, once usb is mounted widget gets uninstalled, you unmount the usb it never enables again, tried enabling it programatically, no luck, can any body help ...

Getting FileSize before InputStream

I want to create a progressBar for an FTP download. The server where I am downloading the file has all of its directories and files hidden. I want to display the progress of the download. Is there any way I can get the file size? Here is my current code: FTPclient = new FTPClient(); FTPclient.setListHiddenFiles(true); ...

passing variables to an outside class.

I split my inner View class from my Main class into its own file. In my main class, I have the view set as an onTouchListener which records user movement into a matrix so it can translate and scale the view. After separating it everything works but im unsure how to pass the matrix to the View for onDraw to update. Any suggestions? Thanks...

how to use android sync api to stop auto sync function?

I'm working in android 2.1, and now I neen to stop the android auto sync process, and when I call the sync process, it will be synced, if you tell me how, i will be very happy, thank you ! this is my code to modify the auto sync function, but I think that it dosen't have really effective. ContentResolver.setMasterSyncAutomatically(fals...

Opening browser activity, but prevent it from being in the activity history

I'm working on an app that launches the browser activity to perform a Twitter OAuth authorization. This process uses a callback url which will re-launch the activity that started the browser activity in the first place. My problem is that the browser pages remain in the history stack and when the user then clicks back from the preferen...

Gmail subaddressing ('plus sign' addressing) in Android

This is a very simple issue. I'm trying to put a link to an email address in a TextView, using Html.fromHtml. body.setText(Html.fromHtml("<a href=\"mailto:[email protected]\">Contact</a>")); When that link is clicked, a new email is addressed to "emailaddress [email protected]". Notice that the plus symbol has disap...

How to Create/Run AsyncTask in Service without runOnUiThread()

I have a Service that creates AsyncTasks for downloading files. In activities, we create Runnables or Threads that we pass to Activity.runOnUiThread(). I can't access that method from a service, so how do I use AsyncTask correctly, (do heavy work without blocking the UI Thread)? ...

How to read local xml file is resource folder as a input stream in android?

Hey All, I am trying to get a input stream from something like this. InputSource myInputSource = new InputSource(activity.getResources().openRawResource(com.MYCLass.R.xml.programs)); myXMLReader.parse(myInputSource); and then call parse on the parser instance i Created. SOm how i get nothing . Works fine if I use a server XML.... ...