Discussion Forums  >  Uncategorized

Replies: 5    Views: 275

nbaagain
Lost but trying
Profile
Posts: 4
Reg: Jun 20, 2011
Honolulu
40
06/22/11 05:20 AM (14 years ago)

Disabling GPS, Phone, Internet permissions Android/Windows/Eclipse.

Hi, I made a very simple multipage app that does not need internet connection, GPS, or phone permissions. I have no programming experience and am learning on the fly. I am using a Windows 7 computer with Eclipse. How do I disable all of these permissions? If you would be so kind to explain as simple as possible with step by step instructions I'll be forever grateful. Thanks in advance. Great website/program/community by the way. I can see this becoming an addiction.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/23/11 02:51 AM (14 years ago)
Hi in HA... This is a common question. Assuming you already figured out how to compile, and got your app running in Eclipse or on your device (great job, lots of folks get stuck with that part)...here's how I would do it. a) Open up your project in Eclipse b) Open the Android.manifest.xml file c) find the 'permissions' list and remove the entire line that reads: android.permission.ACCESS_FINE_LOCATION to get rid of the declaration that your app needs GPS. d) Next, we need to remove any reference to the devices location in the source-code. Open the Act_ActivityBase.java file in the /src folder. You'll be looking for all references to a 'locationManager' This is the object that handles all the GPS stuff. Start by commenting out (use two slashes like // in from of any line of code to comment out) the line where the location manager is declared. This should be on line 43. private LocationManager locationManager; turns into //private LocationManager locationManager; Ok, so now that you've commented that out, Eclipse will start to yell at you (with little red lines and warnings) because the code is referencing this in a few places and you just removed it. Funny. Scroll down to line 386 and find a method called 'getLastLocation' This is where most of the magic happens with the GPS. Basically we'll want to GUT this method. The method needs to be there so other things don't break but we'll just empty it. public void getLastLocation(){ ....all sorts of crazy code... } turns into public void getLastLocation(){ } See how it's still a method but is just empty? Just remove everything in between the curly braces. Oh, or, you could comment all this out instead of removing it since you learned how to comment code out earlier ;-). Remove it or comment it out..up to you... A few more places to deal with the locationManager we removed. Find the startListening and stopListening methods on about line 459. Same routine, make them empty. They must exist, just remove everything so they look like... public void startListening(){ } public void stopListening(){} } I'm thinking that should do it? Build that baby and see if it errors when it compiles. If it does we'll need to dig a little deeper. I think that's enough though, you should be fine.
 
nbaagain
Lost but trying
Profile
Posts: 4
Reg: Jun 20, 2011
Honolulu
40
like
06/24/11 11:21 PM (14 years ago)
Thanks much for the reply. I think I'm just about ready to wrap up my application but am having the hardest time creating a new keystore. I do not know the location or how to make one. Please help me! Thanks again!
 
nbaagain
Lost but trying
Profile
Posts: 4
Reg: Jun 20, 2011
Honolulu
40
like
06/25/11 12:08 AM (14 years ago)
Disregard. After about 2 hours of researching, I finally realized I could create a new location by just typing a new location.
 
duk7225
Aspiring developer
Profile
Posts: 3
Reg: Mar 28, 2011
Los Angeles
2,180
like
08/20/11 10:14 PM (14 years ago)
I'm still getting errors when it compiles. Please Help
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
08/21/11 02:36 AM (14 years ago)
@ duk7225: Does this have anything to do with this topic? Not sure, it's about disabling GPS and other permissions, you posted 'I still have errors' You're question isn't answerable. Questions like this, without any details are impossible to answer. Give us some details, tell us what you're working with. For Android, if you're seeing errors you have not configured Eclipse and the Android SDK properly. Start with the Android video in the videos section of the help page.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.