Android :: ReverseGeocode Is Returning Null In 2.2
Sep 22, 2010
Looks like reverseGeocode ( getFromLocation()) is not working in android 2.2. It is not able to fetch the address from the coordinates. It returns null and crashing my app.
In general 2.2 is not stable - 2.1 was much better. UI response , UI rotation when rotate the phone etc doesn't work reliably....
View 5 Replies
Oct 5, 2010
The line "return db.insert(DATABASE_TABLE, null, initialValues);" is returning a null pointer and I cant figure out why! I'd be grateful for any help public class Database extends Activity {
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
DBAdapter db = new DBAdapter(this);
if(db != null){
long id = db.insertUser("test", "test");
Cursor c = db.getUser(id);
Log.d("DB", c.getString(1));
Log.d("DB", c.getString(2)); db.close();.......
View 1 Replies
View Related
Jul 26, 2010
I am using the previewCallback from the camera to try and grab images. Here is the code I am using
private Camera.PreviewCallback mPrevCallback = new Camera.PreviewCallback()
{
public void onPreviewFrame( byte[] data, Camera Cam ) {
Log.d("CombineTestActivity", "Preview started");
Log.d("CombineTestActivity", "Data length = "
+ data.length );
currentprev = BitmapFactory.decodeByteArray( data, 0,
data.length );....................................
View 1 Replies
View Related
Mar 23, 2010
I'm having issues with BitmapFactory.decodeStream(inputStream). When using it without options, it will return an image. But when I use it with options as in .decodeStream(inputStream, null, options) it never returns Bitmaps. What I'm trying to do is to downsample a Bitmap before I actually load it to save memory.
I've read some good guides, but none using .decodeStream.........................
View 2 Replies
View Related
Jul 20, 2010
I am trying to do what I think is a fairly simple task to authenticate a user on my server. I am using AsyncTask as a private subclass of my Activity, however when I try to populate the user object after authenticating it keeps setting it to null. Is there something strange in how the onPostExecute() method is called that is causing this? I originally had the AsyncTask as its own class but ran into the same problem, so I am try to solve this using a private subclass.
View 2 Replies
View Related
Oct 1, 2009
How can I return a value from TabActivity? It seems that the return value from tab pages vanishes and the caller always receives RESULT_CANCELED instead of RESULT_OK.
View 3 Replies
View Related
May 8, 2009
My application that uses geocoding was working fine till last week and now all of a sudden am not getting proper data from the same.
I used getLocality() , which was returning CITY name previously. But now it is returning NULL.
Is something changed? or Has someone faced the same issue?
My application is on SDK 1.0
View 12 Replies
View Related
Oct 15, 2010
I am (supposedly) catching NullPointerException and returning 0 if that happens. But occasionally I get NullPointerException failure anyway. Is catching it this way no enough to prevent this failure?
private char getCharBehindCursor (int offset){ // get a single char behind cursor + offsett CharSequence cSeq; InputConnection inputConnection = getCurrentInputConnection(); if (inputConnection != null){ try { cSeq = inputConnection.getTextBeforeCursor (offset + 1, 0); } catch (NullPointerException npe) { /* failure*/ return (char)0; }
if (cSeq.length() == offset+1){ return cSeq.charAt(0); } } return (char)0;
View 3 Replies
View Related
Sep 2, 2010
Alright, this might be kinda simple, but I cannot figure out how to do this. How can I change this function to return the String class_name? I know that I need to change the function from void to String, but what else do I need to do? Code...
View 4 Replies
View Related
Apr 16, 2010
I am trying to send all my activities to background by calling this.moveTaskToBack(true); on a menu button click, but the call returns me a boolean value false. Please can anyone let me know if my way to invoke this is wrong or if I am doing anything wrong.
View 7 Replies
View Related
Apr 16, 2009
I do not get any results from the Geocoder in the 1.5 preview release. Any information on this? In the maps application it works but my calls simply return an empty list (no exception, all permissions I know of (in this case only Internet) are set.
View 7 Replies
View Related
Aug 10, 2010
I have a set of mp3 files on my computer which i want to be the server. Now i have a web service(Songs_Collection). This web service returns the list of all songs present on the server to the user.The user can download the desired file directly from the server.
I have a small problem :
How does my web service get the list of audio files kept on the server in the folder c:Audio Files.
Someone suggested that i need to keep the names in a "Web Content" folder, but can anyone suggest how should i approach it?
I worked out on this part . But now how do I send it to the client on device ?
Can i send it directly as an array? I guess then some seriliazation-deserialization needs to be done. Or If send it as an XML file then how should I proceed? (This is more important)
View 1 Replies
View Related
Sep 22, 2009
The code snippet below displays a Dialog with a simple login-form. The problem is that when the user hits the login-button, the text that was entered into the EditTexts are not returned on the getText()-call. However, if I set android:setText="foo" on the EditTexts in the xml-layout "foo" is returned on getText(). why the text entered at runtime won't stick?
CODE:..............
and the XML:
CODE:.....................
View 1 Replies
View Related
Jun 14, 2010
I have an application that utilizes the phones DeviceID in various ways. I am now getting emails from users who have the HTC Droid Incredible phone that they are getting the error message I have added to the app that is showing the DeviceID being returned is not valid - which means it is either empty/null or the default ID used in the emulator. I require a valid DeviceID to use my app, and the permissions are all set fine in the XML. It works just fine on every other device, and now suddenly it seems to stop working on this phone. Anyone else having this issue? Anyone find out what is causing it? Does HTC now block this ID on this device?
View 8 Replies
View Related
Apr 20, 2010
I'm a bit new to programming Android App's, however I have come across a problem, I can't find a way to make global variables -unlike other coding like php or VB.NET, are global variables possible? If not can someone find a way (and if possible implement the way into the code I will provide below) to get a value from the variable 'songtoplay' so I can use in another Public Void...
Here is the code:.............
Basically, it gets the value from the Spinner 'hubSpinner' and displays it in a Toast. I then want it to return a value for string variable 'songtoplay' -or find a way to make it global or useable in another Public Void, (Which is will a button, -loading the song to be played)
View 3 Replies
View Related
Oct 11, 2010
The FileObserver class doesn't appear to be working as advertised.
I created a class extending the FileObserver class. I initialize the class to watch the path of the sdcard as returned from the Android Environment.getExternalStorageDirectory function. Everything seems to work perfectly as long as the files are in the ROOTof the sdcard. Any files within SUB-FOLDERS of the sdcard are NOT returned to my public void onEvent(int event, String path) callback in my FileObserver class.
The docs say files in subfolders should be returned to the onEvent() callback but it's not happening. Note, I've only tested on the Android simulator (v2.2) since I do not yet have access to a device. Maybe this is a bug specific to the simulator?
View 4 Replies
View Related
Mar 23, 2009
I have an application that needs to have a user visit a web page to authorize it. After spending time in the Browser the user should return the my application.
Currently, I'm launching the Browser with:
CODE:................
After using the browser, I can go back home and launch my application, which stacks a new Activity on top of the previous stack of Activities that were being used in the application. For example. If the user launches the app, they have Activity A in the stack. From there we navigate to Activity B which then launches the Browser. Then, the next time we enter the app, we launch Activity A, which is pushed onto the stack that already contains an A and B.
My question is then, how can I just go back to the previous stack? Basically, do I have to create a new Activity? Is there a better way to launch the Browser, and then come back to my application?
Also, I've been using the Intent.FLAG_ACTIVITY_NEW_TASK when I start the Browser activity so that my app stays running.
View 2 Replies
View Related
Nov 16, 2010
I think this should be easy to answer. I have an application that does some long calculations, and I would like to show a progress dialog while this is done. So far I have found that I could do this with threads/handlers, but didn't work, and then I found out about the AsyncTask.In my application I use maps with markers on it, and I have implemented the onTap function to call a method that I have defined. The method creates a dialog with Yes/No buttons, and I would like to call an AsyncTask if Yes is clicked. My question is how to pass an ArrayList to the AsyncTask (and work with it there), and how to get back a new ArrayList like a result from the AsyncTask?
View 1 Replies
View Related
Jan 28, 2010
I wish to re-use the Contacts application in a way to enable the user to pick a contact and return it to the parent activity (my application's activity).
For achieving this, I want to inquire about the kind of Intent that will be needed to launch the contacts application.
Intent i = new Intent(Intent.ACTION_GET_CONTENT, ?); startActivityForResult(.....);
What should be the second argument here ?
In the deprecated Contacts API, I could use the following snippet, but not sure about ContactsContract:
Intent i= new Intent(Intent.ACTION_GET_CONTENT,People.CONTENT_URI); startActivityForResult(i, reqCode);
View 3 Replies
View Related
May 6, 2009
I've been researching how to best implement a service which performs a network transaction and returns data to the caller.
Clearly, this needs to happen on its own thread which means some form of async response. I can see at least three ways of doing this--some more complex than others. In the descriptions below, C is the caller, S is the service.
1) C wraps a Handler in a Messenger object, adds this to an Intent. C then calls startService with this intent. S extends IntentService which runs the Intents received in a worker thread. S then sends a message to C via the Messenger. This has the benefit of not requiring any of the async binding process or making an IDL interface that needs to be compiled into C. This seems to be the closes to a Handler-based response mechanism of Local Services.
2) C binds to S and then uses AsyncTask<> to make a blocking call to S. S performs the network transaction and returns the data in the return value or an out parameter. This requires the async binding process, but does not require a callback function since the inter- thread communications is handled by AsyncTask<> and the worker thread is in C's context.
3) Make the function called in S be completely asynchronous. S defines two interfaces: IMyService and IMyServiceCallback. S implements IMyService.Stub. C implements IMyServiceCallback.Stub. C binds to S then calls S via IMyService, passing its IMyServiceCallback binder. S spins up a worker thread and returns immediately. S then calls the callback when it has completed the network transaction.
I am asking for advice on which methods are most appropriate. I do not need the the service running constantly, only when the web transaction is required. C does not use S all the time--definitely don't want to bind during C's onCreate. However, I would like the time from when C determines it needs to use S to getting the results back to be as quick as possible (i.e. adding minimal latency to the already latent network access).
Is there any preference to having the worker thread in C or in S? Are there any significant problems with option 1?
View 11 Replies
View Related
Jun 16, 2010
In my application, I am trying to pass a serializable object through an intent to another activity. The intent is not entirely created by me, it is created and passed through a search suggestion.
In the content provider for the search suggestion, the object is created and placed in the SUGGEST_COLUMN_INTENT_EXTRA_DATA column of the MatrixCursor. However, when in the receiving activity I call getIntent().getSerializableExtra(SearchManager.EXTRA_DATA_KEY), the returned object is of type String and I cannot cast it into the original object class.
I tried making a parcelable wrapper for my object that calls out.writeSerializable(...) and use that instead but the same thing happened.
The string that is returned is like a generic Object toString(), i.e. com.foo.yak.MyAwesomeClass@4350058, so I'm assuming that toString() is being called somewhere where I have no control.
Some of my code
CODE:.........
This is in the activity that receives the search suggestion:
CODE:...........................
View 1 Replies
View Related
Aug 12, 2010
Edit: Okay, I found a solution. Don't know that it's the proper solution, but it does work correctly. Added to the code below. I'm trying to allow a user to select a number of directories from a checklist, and return them upon clicking a "Submit" button. Here's a snippet of my code. It populates the List View with all the directories on /sd card/, and for the initial selection (of however many I pick) when I submit, the log shows the correct choices returned. However, if I un check an item, and click "Submit" again, it still shows as if all are selected. Do I need to write a handler to un check an item? I thought that was taken care of by the choice Mode selection?
View 1 Replies
View Related
Feb 15, 2010
I get the Failed binder transaction error in the logcat when returning the image taken with the camera from the camera intent back to the parent intent (as a byte[] using putExtra). I don't understand why, its not like its a big bitmap or anything. It only happens when i take pictures with lots of light, because then the byte[] is bigger. The error occurs when leaving the camera intent. Does anyone see a mistake in my code?
Here is the code of the camera intent:
CODE:.............
And here is the code that calls the camera intent:
CODE:..................
View 1 Replies
View Related
Oct 9, 2009
The the client side of a content provider consumer I can do something like this, to get a proper InputStream for reading the picture: InputStream is = getContentResolver().openInputStream(pictureUri);
It is a nice API, and will on the server side, the actual content provider result in a call to:
CODE:.......
But what if the picture mapped to the URI is not to be found on the filesystem, but as a memory resource, or generated on the fly.
Can I create a memory mapped File or InputStream, or anything else, so that I am not required to save a temporary file to disk, just to be able to return it to my content provider consumer?
View 1 Replies
View Related
Nov 22, 2009
Hello, I'm testing some code from a demo found in a forum and I'm getting some strange results. My goal is to be able to allow users to access the pictures on their device to choose an avatar/logo. This code run flawlessly except that I only get a handful of images on the phone. And its not even always the same images. Whats more is that it loads those images into a gridview and repeats them for what looks like a number of times equal to the actual number of images that are on the device. And on top of that if I scroll down the through the pictures, and scroll back up, it reorders the pictures from what they were previously. Each time I load the app the pictures seem to be different as well. I have around 400 pictures stored on my phone, and thats what I'm using to test. If someone could shed some light on this for me that would be great. This is my first time using a URI to access content to I'm not sure where to start troubleshooting this one. Code...
View 9 Replies
View Related
Oct 16, 2009
I'm making an app which has a flow roughly as below: User starts on the main screen with an empty list, hits menu, and goes to "add item." (Activity A) User is given a new activity which allows them to specify search criteria, then hits "go" to do a search. (Activity B) User gets a list of results, and can click on one of them to view more details. (Activity C) User sees details of item, and can use a menu item to save it to their list in Activity A. (Activity D) Right now, I am having each Activity call each other Activity for results, and then it is passing the result all the way back up the stack as it returns to Activity A. Is there a way to jump this, since all I want is for a result in Activity D to get to Activity A directly? Note that a user should still be able to navigate backwards (using the back button) through each activity, but if they explicitly save the item in Activity D, I want it to jump straight to Activity A.
View 2 Replies
View Related
Apr 26, 2010
I'm trying to use ksoap to call a simple webservice. I followed this video to try to get started. When I call "getResponse()" on the envelope I just get the string "Error". There's no exceptions thrown or any other detail. I've successfully connected to a simple webservice I just setup on my local machine. Could this potentially be related to being behind a proxy server here at work? My code is below:
CODE:........................
View 2 Replies
View Related
Apr 12, 2010
I have a PreferenceActivity with a bunch of (Sub)PreferenceScreens. Each such (Sub)PreferenceScreen represents an account and has the account-username as its title.
CODE:................
As the user enters sub-PreferenceScreen, and edits the account user-name, I want the outer PreferenceScreen to update it's PreferenceScreen-title for the account in question.
I've tried to add...
CODE:.............
But the accScreen.setTitle does not seem to take effect on the outer PreferenceScreen. I've note that calling onContentChanged(); actually makes it work, but I realize that this is probably not the preferred way of doing it.
I suspect I should call postInvalidate() on some view somewhere, but I really can't figure out on what view and when to do it.
http://stackoverflow.com/questions/2396153/preferencescreen-androidsummary-update may be experiening the same problem as me.
View 1 Replies
View Related
Jul 17, 2010
I'm considering rooting as well but have a question. I'm on three UK and got the phone on contract. Now it doesn't seem like 3 have messed around with the phone and from what I have managed to find out it says they haven't. I am currently on 0.8 bootloader so my question is if I want to go back from root (just in case) which RUU would I use? The 0.8 bootloader one on MoDaCo [this] or this which has two RUUs for 3 UK. And will going back mean that I do not void my warranty with 3?
View 5 Replies
View Related
Jun 24, 2010
I ordered my Incredible on June 9th, and it is suppose to ship by June 30th. When I bought it I was eligible for an upgrade, so I paid the 2 year extended contract price of $299.99 for the phone and a $100 mail in rebate.
My question is that if I get the INC and decide that I don't like it or don't want to keep it, I know that I have 30 days to return or exchange it, but if I do that and try and exchange it for the Droid X, will I still get the 2 year contract price for the X? And if I just decide to return the phone and stick with my old phone, is my contract still extended for another 2 years?
I'm just wondering for a what if situation so I can handle any issues or problems before they come about.
View 2 Replies
View Related