android

How can I return the location pressed to the MapActivity from an Overlay onTap method

Hi, I have an activity that has a button which opens a new MapActivity to select a location by tapping on the map. The map has an overlay that overrides the onTap method to get the location but I want to return that location to the previous activity but, I don't know how to return the geopoint to the mapactivity in order to call the se...

Floating popup window - how to implement

I would like to have the following screen in my application: button at the bottom of the screen; when user presses the button, a list with a number of items will appear and user should be able to click one of those to start another activity. The number of items can be different (depending on some other conditions); the popup is to be ad...

Get calling context in a service

So I'm working on a service that will handle requests to send data to a socket. I've done socket programming in a service before, but only within the same application. I'd like this to just sit and do nothing until any application wants to give it data to send. That's all well and good. I have register an intent filter and the usual st...

How to set different locales in android?

In my application, I need to display strings according to user locale selection. So, I put my strings.xml in values-en, values-ko, etc. How can I set locale us, australia i.e; values-en_US, values-en_AU? But it's throwing an error? Can any one tell me how to set these locales in my code? ...

android alert dialog from service

How do i display dialog from a service ? ...

Creating Directories to categorize the images based on its type in Java/Android?

I have to create a multiple directory like this path("images/wallpaper/flower"). It should be stored in the External Memory of the phone. How to do it? Any Idea? ...

How to properly zoom a WebView together with it's background image?

I'm using the following code which only zooms the loadData. How is it possible to zoom the image inside? Thank you in advance! WebView web = (WebView) findViewById(R.id.myid); web.loadUrl("file:///android_asset/image.jpg"); web.getSettings().setBuiltInZoomControls(true); web.setBackgroundColor(0); web.setVisibility(ImageView.VISIBLE...

problem with service

HI, I am writing a simple service application, below is the code of Activity and Service..,when i am calling startService(),and stopService() its working fine for the one time,in my case it has to give notification..from next time onwards if call again startService(),and stopService() its not giving desired results... Please help me i...

Android Dev: max screen length

I am creating an application for android OS. The problem im facing is that running the application on different devices with different resolutions, the layout eitehr become too small, on hi res screens, or too chunky on low res screens. How do i make it so that my layouts adapt to the screen on the device?? Do i use relative layout Or is...

android render issue causing delays ?

Hi, I'm developing an Android game and I've got the garbage collection to the point where it GC's only about once every 5 minutes or so, which I think is acceptable, for now. The problem is that, every once in a while, I'll see this message in the logs: 08-29 09:58:46.410 W/copybit ( 1912): stretch_copybit::run_render fail 08-29 09:59...

Saving Application State in Andoid

I am writing an app where I get all the data from the rest call and display all the data in a custom component list(based on Linear Layout) which is added to a LinearLayout. I write this code in onCreate of the activity. The problem is when I switch activity using startActivity, and come back to the calling activity (using startActivity...

parent directory of file not writable

I am getting error like this " error:parent Directory of a file not writable" in android. I've included WRITE_EXTERNAL_STORAGE permission, but it's not working. ...

SQLite Database and Data Access Logic

Problem : I have to create a number of tables for caching some amount of textual data, obtained by reading XMLs. These tables need to be created only once - on the initial run of the application. The data in the tables should be cleared after fixed time period. There should be a class exposed to other classes that would allow CRUD opera...

setOnClickListener not response on Android WebView

Hi , I have Android LisView that was contain TextView to display the data in the list, I add to change it to Webview, after doing that everything look good except the setOnClickListener that not responding anymore.. I have read about the Webview and found that setOnClickListener is not supported, instead setOnTouchListener is support...

Android; MapView, how can I set default location?

Using the MapView in android, how can I set a default location, so that everytime I load up this application, it automatically centers/zooms location in on London? ...

TableLayout background from sdcard

hey :) I want to put a background image in may java file from an image stored on the sdcard. I use the code below but with no success :/ TableLayout tl=new TableLayout(this); int tmp = this.getResources().getIdentifier("sdcard/pic.png", "drawable", getPackageName()); tl.setBackgroundResource(tmp); an idea ? ...

problem with getting photo content of contacts..

Hi, I am using below code to get the photo from my contacts.. but this is throwing exception.. android.database.sqlite.SQLiteException: unknown error: INTEGER data in getBlob_native. please help me if I miss something. int idx = cursor.getColumnIndex(ContactsContract.Contacts.PHOTO_ID); byte[] img = cursor.getBlob(idx); ImageView...

Android:Quick Search Box - Addi9ng Custom Suggestions

Hi All, i am a new bie to android and trying to implement Quick Search Dialog for my application. Acctually, in my application i have an activity 1. where i have a Edit text and Search Button next to it 2. Add Button and a Employee Table below it. Whenever the user enters the search string in the edittext and clicks the Search b...

Get Mail Sent Notification in onActivityResult "Android"

Hi, I am launching a mail activity by //Sending mail final int SENT_MAIL = 1; startActivityForResult(Intent.createChooser(i, "Send mail"),SENT_MAIL); and in onActivityResult(int req, int res,Intent data) i am trying to find the result of email sending, so as to confirm if my mail was sent or was discarded by the use...

android how to get phones photo gallery?

Hello,I would like to show the phone's photo gallery and when the user selects an image then notify my application on the image selected so I can get that images informations. is that possible and how? thanks in advanced maxsap. ...