I'm in a dilemma that somebody may know the best answer. I'm developing an app, that uses a geographic database to get points and current user position. The database that I'm using is PostGis and has 75MB of size. What do you think that fits best :
Develop a webservice and every 5meters do an http request to get user's position?
Use the database inside of the android and get geo information with queries?
Thanks ;-)
It depends on the purpose of your app.
If your app requires the ability to be offline and still function, then obviously the database is required.
If your app does not require offline ability and the data being passed is small, then a service is a good option. If the data is large, then you are back to the database option.
We have had some real challenges with positioning data and the relative accuracy within our app. Another consideration is battery consumption. If you add messaging to GPS polling, it can suck up a lot of battery. Good luck.
Related
I am pretty new to the android app development and I would like to develop an app about geofencing. Under my understanding, geofencing can be related to my own database stored in the device memory and it has a limitation that only 100 geofencing can be used at the same time. (Actually I am not sure if my understanding is right. If it is not, please correct me.)
My question is: Can I store several lists of geofences in my device and only enable the list which I want using the app? so, I can have more than 100 geofences but use less than 100 at the same time.
Short answer: Yes, you can. I'm not sure what the exact space requirements would be but I don't see a problem in saving several lists of 100 entries each.
For more information on how to save data in Android I'd recommend looking at this training module. You don't have to save the data - you could just keep it in working memory and redownload the lists every time. Maybe that would make more sense in your case, I don't know.
My app is growing very fast, and we have used Parse.com as the main database.
We want to create a web version of this to work together with the app for iOS and Android.
The only limitation that we know from Parse.com is that the queries max limit is 1000, so after it you need to create a function to do more queries.
So talking about a very large database, performance on server-side, Users doing queries using 3g network and scalability, is a good way move it to mysql?
Not considering time and cost.
Only talking about performance, scalability and queries to work with Android, iOS and web.
Thank you
In terms of scalability I guess you really need to worry about that if you are managing your own servers. Worse case, you go with a professional hosting service but use VPS.
Parse uses mongoDB which is entirely different than MySQL. The 1000 limit should really be an issue regardless of what database you use because you should be structuring your app that you don't grab anywhere near 1000 items at once. That is where lazy loading comes into play.
Parse is a REST API. This means you're using HTTP requests to get information. You will need to write an API or find an open source option to put on your server. You need to make sure that your code runs efficiently so you can get results fast and put as little strain as possible on your servers.
Another thing is to try and prevent having 1000 queries. If there's a way where you can download data that can be reused in the app instead of re-downloading it each time then do it. Less strain on servers, quick response, and little data going back and forth.
That's really all I have to offer.
Not sure if this would help you, but I'm moving stuff out as well, but you are comparing two different databases to each other. I'm moving my data to Cassandra or MongoDB, that's because the data is key value. As for mysql, I hope you keep in mind, a lot of companies use it for large scale problems and they run it fine. I hope this helps.
I am making a dictionary kind of an app which uses SQLite. I have a single table that keeps the pair of foreign words and their translations. I want to sync this table with a particular spreadsheet in Google Docs.
I ve found this awesome library to retrieve and manipulate GoogleSpreadsheets, so at least I am covered for that. But I donT feel comfortable about the sync. Now,
Can I use a SyncAdapter to do this sync between my SQLite and a GoogleSpreadsheet? If yes, how would I go about it? Would I retrieve and manipulate the rows of the spreadsheet in the onPerformSync or smth?
What could be the other alternatives for such a scenario? Should I maybe use a normal service to do the check when the user requests it (in the main activity, for example) ?
On the Google I/O vids (particularly on Android REST client apps ) they seem pretty persuasive for using the SyncAdapter but I am not sure if it could help me without an actual REST service.
Thanks in advance..
One good reason to use the Android SyncAdapter, ContentProvider and SyncManager is that you will benefit from the Google system knowledge that is useful for preserving battery life and other resources. Some of this content is in the video you link to. For example, exponential back-off logic to prevent wasteful attempts at synchronizing.
There is some good info about battery life preservation by conserving cell radio power in today's Google I/O 2012 talk "Making Good Apps Great: More Advanced Topics for Expert Android Developers." While not mentioned explicitly, I think that the SyncManager is likely to have the battery conserving properties that are mentioned in this video.
Based on my reading (not actually implementing anything) of the APIs and other resources such as the com.example.android.samplesync package, it seems that the pattern is flexible enough to adapt to your program needs.
The team I'm working with has implemented custom sync for our android app but I can tell you we didn't consider this option because we were committed to writing as much logic as possible to run with the WebView. I wouldn't necessarily recommend that, but that's beyond the scope here.
Im writing up a business plan and im having some trouble with the finance part. I put an estimate on the cost of developers, web designers and everything but server costs. Im not a programmer so I dont know all the details. But how much would you think servers are going to cost for a complex app. I cant get into too many details but it keeps track of user preferences, stores data about the user and there is quite alot of back-end to it.
As i said in my response to your comment to #mark; this is a tough question as we don't know enough to make good predictions. To help you make your own predictions
As its only a business plan (i.e. not set in stone) think of a number of users that you want to run on a given piece of hardware - for the data / web servers.
Be aggressive but in the real world as the developers will have to code to make this target and make that part of the spec for the software - 200 concurrent users on a web server for example and that 10 web servers needs a dual core xeon database server or whatever the app needs.
Then you can plot a graph of expansion as it goes; they tend not to be linear so have a lying weasel factor to handle that that rolls the graph off as you go.
Then don't forget about backup, load balancers, firewalls, content managers, caching proxies and all the other network kit you will need.
You will also need to budget for someone to run it all... If its a web app probably 3 to handle it in shifts. Either that or make sure your IT people are the most dedicated so that the servers get restarted in the night when it all goes wrong.
Finally ... Does the system need DR? if so that will need to be included.
It really depends upon the complexity of the app, how much traffic you expect and what platform you need. The real cost is in the time managing the thing.
I would consider amazon aws (http://aws.amazon.com/ec2/pricing/). There's even a free level to get started.
They have system images prebuilt, free and purchasable, that might have the configuration you'll need. You can use one to build an image of your own and deploy it to many servers quite easily if your app takes off.
This heavily depends on the numbers of users that concurrently use your service and of course how much traffic you will have. Without more details it is not possible to estimate any costs.
Edit:
Possibly it is the best if you sit down with a developer, explain her/him what you want to do. There is a good calculation program from amazon webservices (cloud).
You can find it here: http://calculator.s3.amazonaws.com/calc5.html
For example if you would need 5 Linux CPU medium instances for one year + Load Balancers (they will spread the load to the instances) + Traffic (50000GB out + 500GB in) (per user out 1GB/month + in 100MB/month)
This would be all together a One-Time payment $2275 and monthly $7101
http://calculator.s3.amazonaws.com/calc5.html?key=calc-DE0DC116-63C1-440E-BE15-213263DC4E2B
But this is a too complex question to rely only on guesses. The advantage of Amazon AWS is, that you can grow with the application. Perhaps it would be the best to start small and see what you will need.
Take a look at the Dell, IBM or HP sites, say, and see if they quote rough figures. Compare with the cost for services like Amazon's EC2, or Microsoft's Azure. It's impossible to tell you what you need, without knowing what you're actually doing.
Folks, I'm trying to see if my plan realistic at all. I'm ne to
Android platform but not new to software development. This is my first
post here as well :)
We want (in our company) to create Android software to compliment our
truck management software. Basically, it will do couple very specific
tasks.
a. Send GPS updates to server.
b. Receive trip information.
c. Send pickup/delivery confirmation to server.
After evaluationg i. platform and Windows phone 7 platform we came to
conclusion that only Android has multitasking that works for us. So,
Android it is but I have some specific questions.
Data plan we want to use will be very limited. Probably 5M/mo and
no voice/text. I figured 5x1024x1024 = 5242280 bytes will give me 1k
per transmission every 15 minutes (3000 transmissions per mo). It will
leave 2M for other stuff that will happens every couple of days. Does
my math look OK or there is lot of "waste" traffic? Our server going
to be XML SOAP and messages sent will be just Lon/Lat in XML package.
1K will be OK? If I just calculate bytes it will be even less but I
wonder if there is "minimum" packet size, etc. Any insight on this
data limitation appreciated.
Because of #1 we need to "lock" device somehow so there is no other
software that uses network. Possible? If so, what do I need to look
for? I found already created app - firewall and it says phone has to
be rooted for that.
Receiving trip information. What's the best way to accomplish that
given my situation? Should I run some kind of listener? Will my phone
have IP address or something? Or should I get small text plan and use
that for this specific functionality? Can I receive text message in my
own application?
So, as you see we trying to shrink $80/mo service to $15/mo service
that will do big savings to our company but not sure if it's all
possible with constraints we have. Also, we may just give discounts to
drivers who have Android phone and will install our app but we don't
count on that.
Thank you in advance for any help on this subject.
UPDATE:
Now that I think about it - limited data plan present challenges initially but actually helps us do it "right" to make sure we don't overload server with constant polls. What I really like to see is some real-worls experience with data usage. Problem is, to us to even come up with test app - will require considerable effort. Would be much better to rule this out right now if it won't work. For example, if I knew that message size 2k no matter how big of a message itslef - then I would know immediately that it won't work for us..
If you have a very limited kind of data that you are transferring, the overhead of xml might be unnecessary. Instead, pass .csv data to different endpoints dependent upon the data that your are transfering (one endpoint for lat/lon, another for pickup/delivery confirmation)
You do have an ip address on each device, but you're not necessarily going to know that information - it's not constant, or consistent (it can change as the phone moves around). Instead, do a timed polling of the server (that would make your 3rd endpoint) See other mentioned solution of triggering on SMS.
As far as locking the device, I'm not sure about this, but it certainly seems feasible (though it's not consistent with your 'discounts to drivers who have Android phone'. I understand why, but if the phone has no voice/text capability, it's not likely that the phone will be used by the drivers for much besides it's expected purpose.
You are not going to achieve this with a default Android ROM in other words you have to create your own customized ROM from scratch and deactivate quite some stuff in order to get your devices not to use up the 5M/Month.
You can checkout the developers site on the Android source code to check out if that would be an option for you. Giving discounts to drivers owning an Android phone sounds nice and all but I'm quite certain that this is not going to get the desired results which I guess are that you equip all your trucks with such a device and track all of them.
In my opinion it is not going to work with a data plan of 5M/Month but on the other hand I don't know the data consumption numbers without testing.
UPDATE: Also I would not go with XML but with JSON due to overhead.
When you upload a GPS update, have the server reply with any of the trip data you need to push down to the phone at that time.
I think that for the data traffic (the other topics that you asked about are already solved in the other answers) using a bitmask-like solution will be the best option, first bits are for lat, the next for lon, and then some bitmask for the flags, and sending text data only if it is necessary.