I want to build an app that requires me to store and remember locations. I'm not sure if it's possible to remember and distinguish between different Wifi but that would be ideal. I am confused about how to start this and where to go. I read the Android guide on developer.andoird.com. Few question:
1)Firstly when I get the location what do I exactly store/remember?
2)Should I create a database like SQLite to store this information or are there other practices for this sort of work?
Sorry I am very new with Location and Network on Android ... Thanks!
anyone?
AppDevProject said:
anyone?
Click to expand...
Click to collapse
At first you should search and read developer.android.com tutorials and documentation
second- there is several very good tutorials.
And your questions:
1) you can decide what coordinate you want to store (latitude, altitude, longitude, speed, direction, and several others)
2) it's depend of purpose of you app. If you want only log your position, I think at beginning it would be enough to save this data to files (csv file or any other)
If you wish I can send you my example of app which shows your current location
darvark said:
At first you should search and read developer.android.com tutorials and documentation
second- there is several very good tutorials.
And your questions:
1) you can decide what coordinate you want to store (latitude, altitude, longitude, speed, direction, and several others)
2) it's depend of purpose of you app. If you want only log your position, I think at beginning it would be enough to save this data to files (csv file or any other)
If you wish I can send you my example of app which shows your current location
Click to expand...
Click to collapse
If you could please show me an example that would be wonderful!
AppDevProject said:
If you could please show me an example that would be wonderful!
Click to expand...
Click to collapse
Watch this I/O video about the new location api. They tell you how to do it right
AppDevProject said:
If you could please show me an example that would be wonderful!
Click to expand...
Click to collapse
Hi,
Sorry for delay. in attachment you can find sources of my app
Related
1. When I try to open facebook.com in my Opera web browser, they send me to something that is not the original, but som quasifacebookapplicationwannabe. I want the same page as on my pc.
2. I use the weather application and update it several times a day, but I miss one option that I cannot seem to find (if it exists). That is to save the locations I drive through now on my 5 week vacation. When I update, it figures out my new location and changes to this, but I want to keep more of them. Many of the places I visit don't appear in the Add Location function.
Hope you know what I mean
Thanks!
Hmm... try using m.facebook.com or 0.facebook.com (if you are a Vodafone client).
As for your second issue... I don't really understand what it is. You want your device to remember the places where you've been? If not, then please explain.
svartoksen said:
1. When I try to open facebook.com in my Opera web browser, they send me to something that is not the original, but som quasifacebookapplicationwannabe. I want the same page as on my pc.
2. I use the weather application and update it several times a day, but I miss one option that I cannot seem to find (if it exists). That is to save the locations I drive through now on my 5 week vacation. When I update, it figures out my new location and changes to this, but I want to keep more of them. Many of the places I visit don't appear in the Add Location function.
Hope you know what I mean
Thanks!
Click to expand...
Click to collapse
Open your webpage on the Google homepage, and change it from 'Mobile' to 'Classic', then google Facebook, and all should be well.
And if the place isn't in the Add Location function you can't add it to the Sense weather list. You'll need a 3rd party app or to use the internet to check the weather which isn't quite the same as the Sense Weather interface. You'll just have to keep using My Location I'm afraid.
Search these threads, there is an app here somewhere that will allow you to enter arbitrary weather locations based on (I think I remember) a 4 digit code you need to look up for each spot. Sorry, I looked at it but didn't keep it.
dbh369 said:
Search these threads, there is an app here somewhere that will allow you to enter arbitrary weather locations based on (I think I remember) a 4 digit code you need to look up for each spot. Sorry, I looked at it but didn't keep it.
Click to expand...
Click to collapse
Ah yes you're right, I have seen that before but I couldn't make head nor tail of it. If you go the Accuweather website you can get the codes for individual areas, but I didn't have a clue where to input them.
think this is what you are thinking of. I couldnt get it to find my location as it finds it using 'my location', only the nearest big city, but i didnt try for very long.
You could always make use of footprints to take a snap with location data attached, then i bet theres a way to load the whole lot onto a google earth kmz or something.
samsamuel said:
You could always make use of footprints to take a snap with location data attached, then i bet theres a way to load the whole lot onto a google earth kmz or something.
Click to expand...
Click to collapse
I haven't even the slightest idea how to go about doing that, I think a spot of Googling is in order tomorrow.
I've given the little app a go but it seems to only work for major towns or citys. I can't seem to set my local village or town using the code, it just gives the My Location type 'Can't Connect'.
Kalavere said:
I haven't even the slightest idea how to go about doing that, I think a spot of Googling is in order tomorrow.
I've given the little app a go but it seems to only work for major towns or citys. I can't seem to set my local village or town using the code, it just gives the My Location type 'Can't Connect'.
Click to expand...
Click to collapse
cant offer any advice, never used footprints, but it seems like a quick and simple option to gather location
Or you could simply use google maps and save a marker. That might be easier to extract the data from, but yoiu dont get a nice pic into teh bargain, hehe
M.WUND.COM
quick and easy weather site. Even has animated radar.
Hello
I just stumbled over this document: micro-modular.com/docs/AddlRsrc/GSD4e OSP Manual (CS-129291-DC-9).pdf
So, for example on site 119 for example you can see that it is possible to disable the static navigation filter by sending the corresponding Payload Sequence to the SirfIV chipset. The only question which remains is "how can we send these strings to the chipset".
And this is the point where we need some really brilliant XDA developers. If someone would manage to open the communication way to the sirf IV chipset, it would be possible to reconfigure this chipset totaly free.
At the beginning it can be a really simple tool where you have to enter the Start sequence, payload and end sequence which should be send manually. This would be good enough. But the biggest part will be to find a way to communicate with the GPS chipset. Maybe someone knows some good tools to find out how to communicate with the GPS chipset.
I'm very curious on your suggestions.
Best regards,
Chris
And here we can see what static navigation is doing with our tracks. On the right side I was running (high speed) and on the left side I was walking (slow speed). You can see that the static navigation feature freezes the track if you do not move very wide within approx. 30 seconds and releases the freeze if you moved a certain distance. This continues until you are moving at higher speeds.
To generate the tracks the original NMEA data from the SirfIV GPS chipset was dumped every second.
Because of the zoom level you can not see every timestamp, but there IS a trackpoint every second. While at higher speeds they are aligned along the track (right side) the are lying at exactly the same place during the freeze on the left track.
Best regards,
Chris
Maybe an interesting place to search for is the file:
/system/lib/hw/gps.s5pc210.so
Inside this you will find strings like:
MI_SetStaticNav
NL_GetStaticNavMode
NL_SetStaticNavMode
NL_Get_StaticNav_Status
NL_GetStaticNavMode_NL3
NL_SetStaticNavMode_NL3
NL_StaticNav
MI_GetStaticNav
StaticNav: %s3SV
NL_SetStaticNavMode()
NL_StaticNav()
Seems to be interesting.
Best regards,
Chris
And for the usage of the "MI_GetStaticNav" and "MI_SetStaticNav" functions see:
read.pudn.com/downloads28/sourcecode/embed/88065/SDK%20Users%20Guide%20Part%201%20-%20Software.pdf
Page Nr. 196
Is it possible to use the functions defined within the .so file from your own programs???
segelfreak2 said:
Is it possible to use the functions defined within the .so file from your own programs???
Click to expand...
Click to collapse
Yes, it is possible and easily done.
segelfreak2 said:
Hello
I just stumbled over this document: micro-modular.com/docs/AddlRsrc/GSD4e OSP Manual (CS-129291-DC-9).pdf
So, for example on site 119 for example you can see that it is possible to disable the static navigation filter by sending the corresponding Payload Sequence to the SirfIV chipset. The only question which remains is "how can we send these strings to the chipset".
And this is the point where we need some really brilliant XDA developers. If someone would manage to open the communication way to the sirf IV chipset, it would be possible to reconfigure this chipset totaly free.
At the beginning it can be a really simple tool where you have to enter the Start sequence, payload and end sequence which should be send manually. This would be good enough. But the biggest part will be to find a way to communicate with the GPS chipset. Maybe someone knows some good tools to find out how to communicate with the GPS chipset.
I'm very curious on your suggestions.
Best regards,
Chris
Click to expand...
Click to collapse
Not Applicable.
The GS2 has a GSD4t, not a GSD4e. It's the "crippled" version of the Star IV that uses the host processor to do all the work.
Entropy512 said:
Not Applicable.
The GS2 has a GSD4t, not a GSD4e. It's the "crippled" version of the Star IV that uses the host processor to do all the work.
Click to expand...
Click to collapse
Hello Entropy512,
thank you for your comment. I know that the SGS2 has a GSD4t unit. But despite the document is named GSD4e OSP Manual... it is also applicable to the GSD4t version. So it is written in the document. And as I posted, there is a .so file who has all these functions in it. We just need to use it. And I think that the functions provided within gps.s5pc210.so are really worth a try.
aerobahn said:
Yes, it is possible and easily done.
Click to expand...
Click to collapse
Hello aerobahn,
many thanks also to you for your input. Your answer sounds great in my ears . I think it should be worth a try if it is really so easy to use functions defined within a .so library file. I do not have any experience in programming for android, but if someone who has would try it I would appreciate that. Because without static navigation the SGS2 would be a very good GPS logger too. And this can be somtimes very valuable, for geocaching, hiking tours, even low speed navigation...
Best regards,
Chris
No one who wants to try? Please. If you succeed I'm willing to honor your effort.
I have no programming skills at all but i am able to test whatever lib is generated
I can test daily in a 30 Km path (and 30 Km back).
segelfreak2, what you really want is to enable satic navigation and not disable it, as it is already disabled by Samsung. Static navigation disabled means filtering is ON. Static navigation enabled means filtering OFF. It is a common misconception.
Nevertheless, I have developed a tool called GPS Control for SGS2. You can check it out on market. It does exactly what you need. Just remember to reboot after changing Static Navigation config. It requires root access and works only on I9100.
You are welcome to propose any additions you might want in future versions.
The app doesn't work with CM7. I'd like to know if static navigation is enabled in CM7 by default.
Sent from my GT-I9100 using XDA App
Yes, it is not supposed to work with CM (yet). Just send me your gps library file (.so) and I can update the app so that it works with CM also. (or I'll just send you a modified .so)
It's not working with MIUI too. If you tell me which file(s) you need, I would give them to you. At the moment it just says unknown driver.
Sent from my GT-I(OVER 9000!!!!) using XDA App
In recent stock firmwares the file is /system/lib/hw/gps.s5pc210.so
In older ones the file was /system/lib/hw/gps.GT-I9100.so
steffato said:
segelfreak2, what you really want is to enable satic navigation and not disable it, as it is already disabled by Samsung. Static navigation disabled means filtering is ON. Static navigation enabled means filtering OFF. It is a common misconception.
Nevertheless, I have developed a tool called GPS Control for SGS2. You can check it out on market. It does exactly what you need. Just remember to reboot after changing Static Navigation config. It requires root access and works only on I9100.
You are welcome to propose any additions you might want in future versions.
Click to expand...
Click to collapse
I'm curious, why did Samsung disable static navigation by default?
I think this would be good for those who uses the phone to track their marathons etc
mengsuan said:
I'm curious, why did Samsung disable static navigation by default?
I think this would be good for those who uses the phone to track their marathons etc
Click to expand...
Click to collapse
As long as you don't walk the marathon, you should be fine
@ steffato: I've sent you a pm with the .so files​
Just updated the app in the market. It now should support both MIUI and CM. Try it and I 'm waiting for results. Thanks for your input.
Please be patient. The update may take some time to show up in the market.
Raudi1 said:
As long as you don't walk the marathon, you should be fine
@ steffato: I've sent you a pm with the .so files​
Click to expand...
Click to collapse
I tried endomondo on the phone. It does "pause" my location and then update seconds later. Average speed is 9-10km/h
Sent from my GT-I9100 using Tapatalk
Don't forget to reboot after changing setting. It's required or there will be no change. On some cases the phone may crash and reboot on its own, unless you rebooted after changing settings.
If you want to check your gps behaviour after enabling static navigation, you should try disabling any filtering options that you app might have. I test with locus after disabling filters.
Don't test it with googlemaps. There is filtering in that app, therefore gps behaves the same either with sn enabled or disabled.
Sent from my GT-I9100 using xda premium
thank you.
your program is working quite good.
mayby you should create a separate topic in the original dev forum?
the question is how it influence battery life?
Sent from my GT-I9100 using Tapatalk
Hey All -
First, really quick background: I'm a ASP.NET / .NET programmer, and taught myself Java and Android while making the one app I have released (for a hobby of mine) - https://play.google.com/store/apps/details?id=com.tsqmadness.bmmaps
Now, having said that, I'm looking to upgrade my app with a couple features (version 2.0, baby!), and was wondering how to make an 'add on' apk to access from the initial app.
For example (this is one of the several uses I am thinking of for the 'add on'), the easiest one would be -
Main app wants to access an add-on apk to call a function to grind some numbers, and return a result. If that add-on APK's not installed, then the user wouldn't be able to use that function.
The UI stuff I can handle easily, the main purpose of my question here is -
How can I tell if the other 'add on' APK is installed, and
How do I access a function (in a class or some such) in the other APK?
Honestly, I'd google it, but I'm not sure what this process is even called, so my searches have come up pretty sparse.
Thanks guys -
-Mike.
Do you want it to be a feature unlocker? Like a pro version key? For that purpose I'd recommend in-app-purchases because the user doesn't feel limited during download because he's got "just" the free version.
If you want it to execute methods, you could have a look at shared user ids and system broadcasts.
nikwen said:
Do you want it to be a feature unlocker? Like a pro version key? For that purpose I'd recommend in-app-purchases because the user doesn't feel limited during download because he's got "just" the free version.
Click to expand...
Click to collapse
Originally, this WAS a plan. I have switched to in-app purchases for that now, however.
nikwen said:
If you want it to execute methods, you could have a look at shared user ids and system broadcasts.
Click to expand...
Click to collapse
Thanks, that'll give me a starting place to search on. I was thinking a few other reasons for it as well (like, a map marker pack, for a limited basic example..)
Thanks-
Mike.
coyttl said:
Originally, this WAS a plan. I have switched to in-app purchases for that now, however.
Thanks, that'll give me a starting place to search on. I was thinking a few other reasons for it as well (like, a map marker pack, for a limited basic example..)
Thanks-
Mike.
Click to expand...
Click to collapse
Welcome.
The difficult part will be returning a result to the original app.
I'm trying to build an app for a school project that will locate items in a grocery store. For example, if I type in "orange juice" into the app, it will create a marker on a floorplan of the store. In this way I want to be able to populate a map with markers that correspond to items in a grocery list. Users can then walk around the store and swipe off markers as they pick up the items.
Does anyone know how I could do this? Are there any open source Android apps currently out there I could look at?
I feel like this would be a fairly simple project involving just uploading a .jpeg into an app and assigning coordinates to classes of items, like "juice" to {20,30} or something like that, but I have very little programming experience and am lost as to how to start.
bump
Well, people normally do not get an answer if they ask how to do the whole app.
So try to find the solution yourself and ask the community if you've got more specific questions/problems.
nikwen said:
Well, people normally do not get an answer if they ask how to do the whole app.
So try to find the solution yourself and ask the community if you've got more specific questions/problems.
Click to expand...
Click to collapse
Yeah I realize that I'm not going to get a step by step process... but I was just asking for general advice. Somebody suggested I use a .shp file and use an overlay with all the markers corresponding to the items, then create a pop up marker event for every time the user selects an item, which was helpful.
I'm looking for general ideas on implementation, that's all.
justinyeh said:
Yeah I realize that I'm not going to get a step by step process... but I was just asking for general advice. Somebody suggested I use a .shp file and use an overlay with all the markers corresponding to the items, then create a pop up marker event for every time the user selects an item, which was helpful.
I'm looking for general ideas on implementation, that's all.
Click to expand...
Click to collapse
You could save the name and the coordinates to files using JSON which can easily be written manually.
Have a look at Google's gson library.
Hello,
I am developping an application for EPG, but I have a big problem.
The application is very slow cause the construction of the Fragment view after commit() it takes a lot of time.
Operations:
- download of the xml file from an URL
- parsing all data
- saving data into a local db
- reading data to build the fragment view
The fragment has the following layout:
- 2 ScrollViews (1 horizontal and 1 vertical)
- 1 LinearLayout Vertical
- 1 LinearLayout Horizontal for every channel
- 1 or more inflated RelativeLayouts for every Program
- TextViews for program details (title, hour, rating....)
Here an image to explain the sctructure:
s22.postimg.org/v5buk76q9/EPG_Layout.png
All this make the app not usable and it crashes.
Does anyone have a solution for this?
THank you very much
Download and save your file in another thread or use AsyncTask and update local version. Display only the local version in your View.
Regards
EmptinessFiller said:
Download and save your file in another thread or use AsyncTask and update local version. Display only the local version in your View.
Regards
Click to expand...
Click to collapse
Thank you. The problem is in the creation of the view. Not in the downloading... but what do you mean with update local version and display only local version? I'm using a local database where I store parsed data.
sheikko said:
Thank you. The problem is in the creation of the view. Not in the downloading... but what do you mean with update local version and display only local version? I'm using a local database where I store parsed data.
Click to expand...
Click to collapse
He means that you show placeholders on first start, and begin to download the images with an AsyncTask or a worker thread, make sure to read this guide on processes and threads, especially the Threads section!
You place your downloaded images somewhere on the device in your database and use those whenever they are available on future runs of your app. That way you don't need an internet connection everytime.
SimplicityApks said:
He means that you show placeholders on first start, and begin to download the images with an ..., especially the Threads section!
You place your downloaded images somewhere on the device in your database and use those whenever they are available on future runs of your app. That way you don't need an internet connection everytime.
Click to expand...
Click to collapse
I'm downloading the entire programmation for 8 days and I'm saving it in the db. This work takes about 1:30 minute, but only the first time I run the app after the installation. To have the view of the EPG working I have to wait about 30 seconds, and this occur every time I quit to app or I modify some parameters for example the Favorite Channels.
Do you think your solution can help me?
What do you exactly do, when you have to build your view content? Can you store information in local fields (RAM of your phone) so that you do not have to reload them from your db each time?
How big are your pictures?
LG
sheikko said:
I'm downloading the entire programmation for 8 days and I'm saving it in the db. This work takes about 1:30 minute, but only the first time I run the app after the installation. To have the view of the EPG working I have to wait about 30 seconds, and this occur every time I quit to app or I modify some parameters for example the Favorite Channels.
Do you think your solution can help me?
Click to expand...
Click to collapse
I don't know what you're downloading here and wether you own the server counterpart or not, but at the first glance that is waaaayyy too much data you are using here...
You need to modifiy or restrict the amount of data you download from that server, if you can modify it there (If you use images crop them down in there already) it would be best, otherwise you might want to mirror it on your own server.
And what's your app showing when no data is available? You can still show the base navigation and use ProgressBars to indicate you are loading...
SimplicityApks said:
I don't know what you're downloading here and wether you own the server counterpart or not, but at the first glance that is waaaayyy too much data you are using here...
You need to modifiy or restrict the amount of data you download from that server, if you can modify it there (If you use images crop them down in there already) it would be best, otherwise you might want to mirror it on your own server.
And what's your app showing when no data is available? You can still show the base navigation and use ProgressBars to indicate you are loading...
Click to expand...
Click to collapse
Thank you,
To improve performance I saved icons (channels, rating) locally in drawable resources and I download only text info. But because the are 8 days of tv scheduling and a lot of channels this download take a lot of time.
I can't modify o restrict the amount of data, but i can select how data I can download (i.e. 3 days....) but I have to download all.
Also when I modify (add/remove) favorite channels I have to wait about 10 seconds and this is frustrating.
Maybe the problem is that I'm working directly on the database. I have to work on some layers above do DB or there is another solution?
Sorry but I'm new to Android
Thank you
sheikko said:
Thank you,
To improve performance I saved icons (channels, rating) locally in drawable resources and I download only text info. But because the are 8 days of tv scheduling and a lot of channels this download take a lot of time.
I can't modify o restrict the amount of data, but i can select how data I can download (i.e. 3 days....) but I have to download all.
Also when I modify (add/remove) favorite channels I have to wait about 10 seconds and this is frustrating.
Maybe the problem is that I'm working directly on the database. I have to work on some layers above do DB or there is another solution?
Sorry but I'm new to Android
Thank you
Click to expand...
Click to collapse
And I'm new to EPG xD. Do you have to download all the channels or can pick e.g. just the favorites? And what is the size of your local db on the device?
Well then the only thing I could tell that either you have a serious performance bug in your code or you need to find a way to get less data or load it faster. I don't know if mirroring it on your own server is possible but there might be some free servers providing it.
SimplicityApks said:
And I'm new to EPG xD. Do you have to download all the channels or can pick e.g. just the favorites? And what is the size of your local db on the device?
Well then the only thing I could tell that either you have a serious performance bug in your code or you need to find a way to get less data or load it faster. I don't know if mirroring it on your own server is possible but there might be some free servers providing it.
Click to expand...
Click to collapse
I can pick only some days and I can select wich days to download.
Now I'm downloading only 3 days and the size of the db is about 4 MB
May be I have a bug
How I can get them faster?
Can't mirror or move content.
thank you
sheikko said:
I can pick only some days and I can select wich days to download.
Now I'm downloading only 3 days and the size of the db is about 4 MB
May be I have a bug
How I can get them faster?
Can't mirror or move content.
thank you
Click to expand...
Click to collapse
4megs seems to be alright on the first look... Maybe you really have a bug or you are loading it on the UI Thread. You need to use asynchronous loading or the db is too slow. Maybe disable any loading in the app and see if you get any improvements, if you don't, you have a bug in your layout/app