android

Can an Android Service have multiple Permissions?

I have a service which both downloads a file and saves it, and it seems I can only specify one permission. <service android:enabled="true" android:name=".DownloadService" android:permission="android.permission.INTERNET"> </service> or <service android:enabled="true" android:name=".DownloadService" ...

How Android app can initiate Bluetooth HFP and A2DP connection to Bluetooth Headset?

In my understand, Anroid app supports only SPP connection not HFP and A2DP. However, I want to initiate HFP and A2DP connection in Android app just like selecting Bluetooth device in Bluetooth Settings menu. I'm not sure it is possible to use a intent including BluetothDevice object, so the intent receiver can initiate HFP and A2DP conn...

why was the onNothingSelected in spinner not invoked?

Hi all! I have an Android Spinner and I want to listen the event when the user press "Back Key" when the spinner's select panel is showing.I have implement the OnItemSelectedListener ,but the onNothingSelected(AdapterView arg0) was not invoked when press back key. I just want to listen the event when user select nothing( or the select...

how to call new XML file in android

Hi, everyone I'm new to android! how to open a new window (or form) when the click event rises for a button or menu? (similar question !) how to open XML file when click or any other event rises? Thanks. ...

Creating AlertDialog with Static Methods?

I've completed most of the game I'm attempting to make and throughout the project I've created one particular Activity which also calls a SurfaceView and a Thread. I put an update() method in each of the 3 classes so they each know where the other ones are everytime something changes. Apparently, the only way to do something like this ...

How to implement an Android detail notification?

This has probably been asked before, but I can't find a good way of implementing it. I'm trying to write a program that manages a form of messages, and these messages are received from an external data source. This all works. However, the problem comes when I try to notify the user: I would like to have the notification jump directly ...

Android - Supported Image Types

Hello all, i have searched on the Image types supported by Android everywhere. Actually, my confusion is which are image types supported by Android (i.e. JPEG, gif, or other) , because just now i have done camera capturing code with JPEG, but when i go and open the Albums from my HTC Hero, then i cant view photos and images which i hav...

external xml file integration in android

Hi Folks i am developing one application for displaying images and labels and its sound.i want to get this info from xml .where i need to keep xml file in android project how to get values from that xml file Thanks in advance Aswan ...

shell/ batch scripting to direct commands to adb shell

I am trying to write a batch(for win) and a shell script for linux to automate key and touch events on a android UI. At the moment in a windows batch file I am starting a adb shell for each event for eg :again adb shell am start -a android.intent.action.MAIN -n com.q.me.fui.activity/.InitActivity sleep 15 adb shell sendevent /dev...

which is the suitable method to recyle bitmap?

friends, i have a page on which i am displaying image from gallery then i have next page button to move to next activity on that button i am using clearBitmap(); to free memory used by it. private Bitmap bitmap; oncreate() { _image = (ImageView)findViewById(R.id.MyImage); _path = getRealPathFromURI(_data.getData()); B...

Dynamic addition of text view by clicking on button

If i click on a button on one layout it should add text view in another layout dynamically again if i click that button same procedure should get repeat. ...

Saving image, webview, android

Hi, I am using webview in android to display images (mainly using google ajax API), Now if I want to save an image into local storage, How do I do ? I have image url, which can be used for saving. ...

Android + Twitter + Oauth + access token

Hey guys, I am trying to make an android app for twitter. The code that i am using for the login is given below : package com.twitter; import org.apache.http.HttpVersion; import org.apache.http.client.HttpClient; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.conn.scheme.PlainSocketFactory; import org.apach...

how to access path of database or file of different app in android

Is it possible to get path of database file in android at path : "/data/system/accounts.db" in my app i want to use this database, but not getting its path. if i do hardcoding and remove the file i'm able to do it. But i want to access it as database so that i can drop the table. Any help would be appreciable. code i tried: priva...

Problem acquiring wake lock from broadcast receiver

Hi I have a problem. I am trying to make a broadcast receiver acquire a wake lock so my alarm will wake the phone from sleep mode. In the broadcast receiver below, the program crashes with "source not found" on line "sCpuWakeLock.acquire(); when the class "AlarmAlertWakeLock" is called by AlarmReceiver. Any idea what's going on? Is th...

Get the number of unread mails on an Android Device

Is there a way to ask the mail programms on an Android Device how many unread mails they have? ...

how to dynamically load the app list in android

Let's say, there are four apps in the system: app1, app2, app3, app4. Be default, when the system is up, all apps will be shown in the home screen. Now if we provide a customized log in screen, user A log in, then for this user, he can only see (and use ) app1 and app2. Then A log out, user B log in, he can only see app3 and app4. Doe...

Android - acquiring a hold lock from a broadcast receiver

Hi. I am trying to acquire a wake lock in a broadcast receiver so that my alarm clock application can wake the phone from sleep. It crashes at the following line in the code below: PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag"); Any ideas what's going on? Is there a better way to do this? Tha...

Load images or whole site from local "assets" folder using webview, ANDROID

the question i have is simple but hard to put in words, ill give it a try anyways. i am trying to load a web page in webview, however the load time is a little high. -is there anyway i can put the images in the assets folder and load them from there instead? -if not, is there a way i can load the whole site from the assets folder, prov...

Android-Intent with OnItemClickListener

Hi, I am new To Android.I have created ListView.I have used OnItemClickLIstener with the ListView .It works.Then i tried with Intent with OnItemClickListener.the Code is ArrayAdapter<String> adapter =new ArrayAdapter<String>(TabHost1.this,android.R.layout.simple_list_item_1,new String[]{"4324234","432432","445456"}); ls2.setAdapt...