android

try to do a public method

i want to create a method to open a popup when i click on it and the title and the text would be automatic, something like this : public void Display(String test){ new AlertDialog.Builder(this).setTitle(getTitle()).setMessage(test).setNeutralButton("close", new DialogInterface.OnClickListener() { @Override ...

how to set equal top and bottom of image in android?

Hi Friends, i want to set equal top and bottom of each images,how can i set for all images in android? anybody know please give the code for that Thanks all ...

iPhone and anyother Smartphone peer-to-peer communication over bluetooth

Hi, i want to build a simple bluetooth chat program that can do a 2 way chat with 2 mobile devices. i know that i can use gamekit to develop such application for iphone and ipod touch. But i want to know is, is it possible for other smart phones (running my application) to discover and communicate with ipones and other devices as wel...

Android list activity

I am using the code below. I want a text view on top of which always stays on top even while the list is scrolled, like a heading. But when I add something to my layout the program crashes. How do I do this? The code: public class list extends ListActivity { private IArmService service; private ArmServiceConnection armCon; ...

how to set image's top and bottom in same size for android?

I want to display image in center and top and bottom in same size refer bellow screens,anybody know please give the code to me... Thanks All ...

android listadapter

protected void onListItemClick(ListView l, View v, int position, long id) { // TODO Auto-generated method stub super.onListItemClick(l, v, position, id); Cursor c = (Cursor) mAdapter.getItem(position); String a = c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME)); Strin...

Android using Super User Permissions ? allowing access

Hello, im trying to find the method behind having superuser access on android devices. basically i want my app to be able to remove system files, and so asking the user if its ok after the app is launched like most other apps, and then what code exactly am i looking to use to perform these sorts of actions? cant find much on google than...

how to inflate footer layout below listview without empty space(please refer screens)

hi.. Here i attached screens please find it. I have listview and below it have footer to bind more data at footer button click event,the data has been binded well but the problem here is expanding of empty space after click event,when i scrolled to move down,when i reach the last list row by scrolling the footer position is being...

How to know in which pixels of a image user clicked?

I want to draw a image filling the complete screen. Then when user clicks in any pixel or group of pixels they turn black. How can I know where the user clicked exactly and how can I turn the touched pixels black? ...

Problem with HTTP Post in Android

Hello! I'm getting a problem making an HTTP POST in Android. The problem occur when the code is reading the response, it cant obtain the complete web page code I want to retrieve. I only retrieve a piece of the web. Here is the code: try { HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = n...

android listactivity and other things

i have a list activityi want to display this list with a text view...but when i add a ext view to my layout the textview repeats with every list item... i want a text view on top and then the list item to display below that... how will i do that my xml file is ...

Android: Detect when user chooses a number (he wishes to call) in the contacts list?

I'm trying to get an Android background service to be "notified" when the user chooses a phone number (he wishes to call) from the phone's contacts list. My goal with this is to prevent the system from placing the call and present a user with a choice dialog, then go from there... Need help. ...

How to have a one-time only Dialog box

I am wondering how one would create a dialog box that only pops up when the app is first opened. For example, I have an Android app on the market. When I update it, I would like to implement a box that pops up that displays what has been updated in the app and will not pop up again until the app is updated again. Thanks! ...

Accelerometer and Gyrometer Data

I'm using the Android SDK (2.2) with a Droid and I have access to the 3-axis accelerometer and gyrometer. I apologize in advance if this reveals my ignorance of physics. It has been awhile. What I don't understand is why the accelerometer is giving different x,y,z values when I tilt the phone. It's standing still, at least, with neglig...

ProgressDialog not updating after Configuration Change (orientation turns to horizontal)

ProgressDialog quits updating when orientation of screen changes. I have put into place a fix that salvages the asynctask and sets the activity of the asynctask to the new activity after it is destroyed and rebuilt. The percentage complete on the progressdialog stays at the percentage it was at before the orientation change. What am I...

Android: Application context, force root intent to show upon launch

Hi, I am writing an Android app in which I've extended the Application class in order to hold some global variables. I initialize these global vars in my root Activity (the first screen that the user sees). My application contains a number of Activities containing ListViews full of selectable items. When the user selects an item, a new...

BufferedWriter#write(int) javadoc query

The Javadoc for this says: Only the lower two bytes of the integer oneChar are written. What effect, if any, does this have on writing non-utf8 encoded chars which have been cast to an int? Update: The code in question receives data from a socket and writes it to a file. (A lot of things happen between receiving and writing, so I can...

How to generate random events in android?

I have a an array of objects and would like to be able to randomly choose one from the list when a button is pressed. How would you do that in Android? ...

Measuring text height to be drawn on Canvas ( Android )

Any straight forward way to measure the height of text? The way I am doing it now is by using Paint's measureText() to get the width, then by trial and error finding a value to get an approximate height. I've also been messing around with FontMetrics, but all these seem like approximate methods that suck. I am trying to scale things for...

How to add SMS in inbox and sent messages in android programmatically?

Hi, I'm trying to write an app that has to manipulate my inbox and my sent messages without sending or receiving a message. This tutorial shows me how i can send messages, but i want my phone to think that i sent one, without actually sending one. I've searched in the Android References and i think i need to use: SMS Manager SMS M...