Android :: Android - How To Initialize A Variable Of Type - Location - Other Than Making It Equal To Null
Jun 6, 2010
I'm looking to test some code I've written and to do so I need to construct a variable of type Location and to give it a long / lat value but I'm unsure how I would do so.
View 1 Replies
Jun 22, 2009
I have tried to understand for the past 2 days what is the best approach to making the value from a variable sitting in activity A (in my case, the int position used in OnListItemClick / OnItemSelectedListener) available in another activity B (which of course sits in another class). There may be the option to write the result of the OnListItemClick int position into a small SQLite DB - but that seems to be total overkill.
Anybody could pls share the best approach with me?
View 6 Replies
View Related
Jan 30, 2009
I am trying to run a simple program which shows lat and long values but Location value is always null.
CODE:...
Emulator shows alert force close - wait
How can i debug line by line, at the moment i am usinng if, else to see veriable value.
View 2 Replies
View Related
Oct 21, 2010
I am trying to create an Android maps project. Everything was working fine until i added Salesforce classes into it. Now it doesn't even compile. It gives me: Type Conversion to Dalvik format failed: Unable to execute dex: null error.
I tried 1) Increasing memory in the .ini file. That didn't help. 2) Project -> Clean option. It cleans, builds again and then gives me the same error.
I am using Snow Leopard and i have the latest version of Android on my system. I just installed it last week. Plus, my eclipse is Ganymede. I even tried it with Galileo.
View 4 Replies
View Related
Oct 17, 2009
I can't display my map on android emulator. i have, locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); location = locationManager.getLastKnownLocation("gps"); After those lines,the Log shows null for location instead of the object location
View 4 Replies
View Related
Sep 28, 2010
I need to disply current Position latitude and logintude...I tried but it will show Null pointer exception.. here with i attached my code...
I run this application on android emulator
CODE:...............
View 11 Replies
View Related
Sep 8, 2009
I'm trying to get a location from lat /lon values with the getFromLocation function:
adresses = geocoder.getFromLocation(lat, lon, 1); // Search addresses
The function should return a empty List, if it don't find an address, but it throws the NullPointerException. What can/must I do to fix it?
View 2 Replies
View Related
Aug 8, 2010
I have an activity that implements LocationListener in my application and my onLocationChanged method has been working perfectly up until recently. For some reason the Location object being passed into the method is null. My question is, why is it null? Does it pass in a null object if it cannot acquire a location?
My GPS is on and I have it set to pull a location from the GPS, and I know my GPS can get a fix on me as I used Maps and had it locate me.
Also, I have the permission for my app set as:
CODE:.................
I don't believe permissions is the issue though, as my activity was working beforehand and I have not altered the permissions since then.
Here is the code that determines the provider of the location object:
CODE:.............
Here is the LogCat output of the error:
CODE:..............
I have tested the same code on another device (an HTC MyTouch 3G to be precise) and it works flawlessly with the GPS, however on my Motorola Droid it crashes.
View 3 Replies
View Related
Sep 14, 2012
I've been looking through the filesystem of android, and for the life of me cannot find the files that make up the settings menu in android. It's been a long while since I've attempted modifying anything myself.
View 2 Replies
View Related
Sep 26, 2010
Is copying the reference to the object and not the value of the object. Meaning, when I modify pos.top or pos.bottom, the original object gets modified. I'm guessing I am missing a concept of pass object by reference vs value here which I thought I understood. What is the fix here? Is it a problem with how I defined my custom class?
View 2 Replies
View Related
Nov 3, 2010
these is how to give a string as argument String link ="http://www.adobe.com /devnet/acrobat/pdfs /pdf_open_ parameters.pdf"; webview.loadUrl(link);But how to give an "URL" variable to load its content to webview.
View 1 Replies
View Related
Oct 12, 2010
When my phone is plugged in my cursor jumps to the left making it impossible to type or access applications that are not on the menu screen all the way to the left. It also navigates itself away from web pages and I think the constant left motion of the cursor makes the phone run slowly. I cant look at maps either.
View 2 Replies
View Related
Jun 7, 2010
The iMovie app was announced with the introduction of iPhone 4 today. Is there an Android alternative that is equal or better?
View 1 Replies
View Related
Jun 25, 2010
I'm wondering how would I make an image that is located at a specific URL equal to an ImageView's image?
View 1 Replies
View Related
Aug 6, 2010
Wanna to split a screen for my app with two LinearLayouts. What parameters should I use to make exact splitting in two equal parts - first LinearLayout on the top and the second one is just under it.
View 2 Replies
View Related
Sep 6, 2010
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.
View 1 Replies
View Related
Nov 16, 2010
I just want to break a large image into some equal parts like 4, 6 or 8.
can we do it?
actually i want to store every parts of image as a separate image in my
drawable folder for future use.
View 1 Replies
View Related
Jun 6, 2010
I have two questions about wallpapers on my nexus one. First off, is there anyway to take a custom image that I have and I am using and put it into the list of "default" backgrounds so that when I change it I don't have to go through that resize hassle and everything and I can have it in a more organized location. Also are there any applications or tools out there to get great looking wallpapers for the nexus one. Sometimes when using an image it doesn't look that good and the selection thing when doing it from the gallery is annoying because of the selection has to be a square yet my screen is 800x480.
View 2 Replies
View Related
Aug 5, 2009
I am building a camera app, where photos and videos are continuously being captured and saved to the SD card. The videos are short (few minutes), and their length are preset with setMaxDuration(). When Media Recorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED is reached, the video is saved, and a new sequence is initialized with something like: The whole process works fine, while the main activity is in the foreground. But, when I go to another activity (e.g. settings), the video recording works in the background only until max duration is reached. The file is saved, but a new sequence can not be started because prepare() fails. setPreviewDisplay() needs to be there, but it doesn't like not having a proper surface to attach to. I tried to use a dummy Surface, a dummy SurfaceHolder, or reuse the Camera with mMediaRecorder.set Camera(), but nothing works. Is there a way to initialize Media Recorder in the background?
View 2 Replies
View Related
May 20, 2010
My problem is that when I start application and user didn't open my PreferenceActivity so when I retrieve them don't get any default values defined in my preference.xml file. Code...
View 3 Replies
View Related
Nov 12, 2010
I've been having an issue with using AudioRecord for Android. I've read as much as I can find online about it, but I cannot seem to get a good initialization. I have tried the Android 2.2 emulator, 1.5 emulator and my phone, an HTC Incredible running Froyo. The emulators and my phone fail initialization. I've tried sampling rates of 8000, 11025, and 44100, formats of CHANNEL_IN_MONO/STEREO and CHANNEL_CONFIGURATION_MONO/STEREO, 8bit and 16bit encoding (8 bit makes the getMinBufferSize fail), and Audio Source of MIC and DEFAULT. All result in the variable test becoming 0 after running a get state(failed initialization). It seems from everything I've read that this should correctly initialize the object. I have played around with the multiplier on buflen, to have it range from 512 (the result of the function) to 102400 because I had heard that HTC devices require something above 8192. For testing my problem I made a new, small project that recreates my problem as simply as possible. I pull out the constants needed into local ints then run the constructor and access the getState method for checking if it worked. Code...
View 1 Replies
View Related
Nov 24, 2009
What is the quickest way to restart or re-init the launcher a core process without the "you've killed the a core process unexpectedly" notification message?
View 2 Replies
View Related
Feb 21, 2010
I m developing an android app, i ve had a problem with the layout editor. I m using eclipse 3.5.1 for RCP/plugin developers, the android developers kit version 0.9.5 and jdk 1.6 in ubuntu 8.04 hardy heron. I ve been working good until one day i had to modificate my UI. when i tried to see my main.xml layout i found the following error: Null Pointer Exception then NoClassDefFoundError: Could not initialize class sun.awt.X11.XToolkit. I was looking for a solution but i didn't find so i reintalled all. Eclipse, ADT, SDK and Java. First it (layout) looked to work again but in two days it broke again. I m so frustrated cause i dont know what i do to get this error. First it works then don t .why?
View 3 Replies
View Related
Oct 18, 2010
I'm adding Android C2DM to a Android library project. I started with the com.google.android.c2dm package that is included with JumpNote and Chrome To Phone. In order to use this package, you have to subclass the C2DMBaseReceiver service which takes the Sender Id as an argument to it's constructor. In JumpNote, this argument is initialized using a hard-coded static variable in a config class. However, in an Android library project, which may be used by multiple concurrently running apps I don't think I can use a hard-coded static variable (that is, I believe it could lead to problems when/if multiple apps are trying to access/modify the static variable). I tried to think of a way to initialize the Sender Id without using a static variable and am stumped so far.The obvious solution would be to use the Manifest or a Resource string or a combination of the 2. For example, in strings.xml I might have a "ac2dmSender" string, which is accessed in a meta-data child of the C2DMReceiver service declaration in the manifest. However, it seems that you cannot get a reference to the PackageManager or ResourceManager from a static context, so there is no way for me to then retrieve the meta data in such a way as to pass it in to the constructor of C2DMBaseReceiver.
View 1 Replies
View Related
Mar 9, 2009
Is is possible to specify data in xml resource file and initialize ArrayList from it? I am looking for a way to use the ArrayList with a SimpleAdapter to bind to a ListView. I am wondering if there is a way to specify my data in xml resource file and init ArrayList from it.
View 6 Replies
View Related
Sep 16, 2009
I am trying to add new contact using intent...
This code works but not adds several phones and company field doesn't initialize. What I do wrong?
View 2 Replies
View Related
May 15, 2010
Or is my Desire faulty?Hi, had my Desire about a week now and absolutely loving it.I bought a couple of spare USB cables from eBay (they were listed as being suitable for the Desire fwiw) - mainly for charging - but why I plug the Desire into my laptop with them I get Device not Recognized - even before I've selected the connectivity option on the Desire.It works OK with the HTC cable and a cable that came with my Jabra headset. The eBay cables seem to recognise an old Nokia 6300. So, as suggested in this thread, are all cables not created equal and the eBay cables of insufficient quality for the Desire or is the Desire faulty?
View 5 Replies
View Related
Jul 17, 2010
Post from XDA...Can someone that has the phone confirm this?Couple of interesting specs - xda-developers. AT&T has posted a new spec sheet on the Captivate here.Couple of things stood out in contrast to information (speculation?) that has been posted on this forum and elsewhere, so wanted to mention them and see if any of the early purchasers can check and confirm.
Memory
Flash (device) Memory16 GB flash memory
Expandable MemorySupports MicroSD cards with up to 16GB of memory
I point these out since some people have assumed that the base specs of the SGS were carried over to the Captivate (e.g., 802.11n, FLAC support, max 32GB MicroSD cards supported). Has anyone checked these on their phones yet?
View 12 Replies
View Related
May 22, 2010
When i had 1.5 my awake time was a low percentage. Now that I have 2.1 my up time and awake time are exactly the same. I don't know what the difference is, or if they should differ. I'm getting good battery life, but i don't understand why these two are the same. Anyone have an answer? Way to fix it?
View 1 Replies
View Related
Aug 9, 2009
I am building a camera app, where videos are continuously being captured and saved to the SD card. The videos are short (few minutes), and their length are preset with setMaxDuration().
The whole process works fine, while the main activity is in the foreground. But, when I go to another activity (e.g. settings), the video recording works in the background only until max duration is reached. The file is saved, but a new sequence can not be started
because prepare() fails, apparently because setPreviewDisplay() doesn't like not having a proper surface to attach to.
I tried to use a dummy Surface, a dummy SurfaceHolder, lockCanvas(), and various other tricks, but nothing works. Is there a way to initialize MediaRecorder without a valid surface?
View 3 Replies
View Related