finding data sources for android app - android

I've come across this problem when thinking about creating different apps for Android. I see these apps that show you the weather cast or sport results, and I wonder which is the source they get all data from.
I assume they don't have their own database which they fill with data manually and live. I suppose they use some kind of web service, data source or something like that. I don't know if web service is the correct term to use in this case (english is not even my native language).
So I would like to know the correct term for what I'm looking for, plus any guidance on finding this kind of services, in order to be able to develop apps using this kind of data sources.
I think this question will help many programming students like me.

It depends what you trying to develope- Some apps use simple GET/POST Requests and get it's data back formatted as JSON or XML (which is the common case).
Some uses SOAP for getting their data.
In some cases they are using plain Sockets or CouchDB.
In some cases they are using Push Mechanism (specially for android) like GCM to send their data to the client.
It always depends what you want to do.

Related

What database should I use for a data visualization app?

I want to create an Android/iOS tablet app that will visualize data from a number of desktop apps that have the same function (facilitating orienteering events) but may be very different in their construction. The idea I have is that when anything changes in the desktop server database, the change is communicated to my tablet app.
Now, I don't know what would be a good form of communication between the server and the app (JSON?), but I think that before anyone would want to consider modifying their desktop app to be able to share data with mine, my app needs to actually work.
So I'm looking to write my first line of code, but I think before I do that, I need to decide on a database. In the tablet app, the user would only be performing read operations. The data itself would be small (short strings and some ints/longs) and structured and work well with a relational DB. Assuming the server communicates all updates immediately, there could be an update on average every 5 seconds for a normal event.
Considering how you described the problem, the data doesn't seem too complex or big; This is more of a "what do you prefer to work with" instead of "what do you need".
JSON in this case is a good format for your data, and if you like working with it, then that's a good solution.
If you want to use JSON format, MongoDB might be the best choice. Easy to learn, big community, pretty advanced and complete.

Android application backend

I want to make an android application which will display an external message (For example: some quotes, proverbs etc) daily.
The message should be retrieved from some place other than the client device and I would like to configure the messages from back end
These messages should also change everyday.
How should the back end be and how can the android application retrieve the configured message ?
Do I need a server at the back end for the same or can avail some cloud services for the same ?
What is the best approach to do?
If you want to avoid having to set up and manage a server on the backend yourself you can take a look at a 'backend as a service' offering.
Two example candidates are:
https://parse.com
http://aws.amazon.com/lambda/
Both Parse and Amazon provide SDK's to allow you interact with the backend from your Android app.
You will likely want to study this a little to decide if you want this type of solution or to build your own server as Brian suggests - I think there are pros and cons to each approach and you'll have to choose which is best for your case.
Yes, you will need a server. You can start building the server software on the same machine as your Android emulator and create them in parallel. You'll need to choose a language and most likely a web server framework that suits your thought process and style.
If you want to use REST, for instance, google some for "best REST server framework". You will get hundreds of answers that don't mean much, but look at the communities that surround the frameworks that come back. Look at the user lists and how many questions about it exist on this site. That will give you a better idea of whether you can ask questions and get answers when they arise. You are making an investment by learning a framework, spend a little time deciding which one you are going to use, possibly by trying a few of them for a very simple site that returns the kind of data you are looking for.
Other than that, you really need to ask specific questions once you've chosen a language and a framework. Hope that helps.

Pushing data into the cloud with android

I am trying to push some sensor data from android onto the cloud. There seems to be certain existing sites like xively, thingsspeak,nimbits which do all of this. But the thing is I need to be able to dynamically create new devices without logging into the site and also push data from the android phone to those sites. I can do the latter easily but the former seems to be an area where there is a lot of restriction. I also need to describe my sensor data very accurately so I would probably need several extra fields. Taking all this into consideration I have come to the conclusion that creating my own database would probably be the best way to proceed. However I would like to know if this option is the right way to proceed?
Also are there any easy to use libraries which help me contact an external sql database easily in android?
Yes, you should probably have your own backend for something like this. Google App Engine has a feature called Cloud Endpoints that makes it easy to write an Android backend and auto-generate an Android code for communicating with it. And it automatically handles the serialization/deserialization, so that you don't need to parse/serialize XML or JSON in order to send the data.

Persistance of complex Java objects (SQLite, Serialization, JSON) and client-server app architecture

I'm working on an Android application which is fetching data from internet among other things. Actually, the project was started by someone else which is not here anymore,
and now that I have to turn it into a light client application and implement the server side (in Java), I'm wondering what would be the best tools/patterns to use to fit my needs.
Let's say I have to deal with several models (class representing a category) of objects which all inherits from one class : they have common attributes (such as name, attache thumbnail...) but specific properties too.
Because of this,you can understand that I can't afford to manage one specific table to map each single class.
However, I still want to be able to cache my objects somewhere in the Android device to populate the views of the application when working in offline mode.
Currently, the solution used by the previous developer was to store data directly into a TEXT field in the SQLIite database, as serialized objets.
This should be ok on the server side but I've read that the usual Java serializaton was very slow on the Android platform, although it is not really noticeable now because I work with around ~50 objects, I was looking for more performant alternatives for the future.
I've came across the JSON solution which can easily handle complex structures and Jackson library seems very interesting with its simplified data binding to POJO objects and its well-known performance.
But then, how should I store my Json objects ?
Is it possible to keep a json string in a TEXT field of a SQlite table ?
Or should I rather store them as .json file for each object ?
Which one is the more efficient to retrieve later lot of data?
Plus, I was thinking that JSON would be a very good exchange format between the Android client application and my server whould is in charge of processing the information from internet third-parties apis and exposing this data with webservices. (rather than trying to implement some RMI-like solution)
Is using the usual Apache HTTPClient enough on Android to communicate with the server?
For those who successfully developped client-server application (which seems very common to me) is this a good approach for Android ?
It seems to me that with mobile platforms, you can't really use the approach that you've learned for more classic J2EE app and such...
Any advice would be greatly appreciated because I'm a student and Android beginner who really want to improve her mobile development skills !
Thanks :)
That's open to discussion, so SO is probably not the best place to ask. In general, before declaring something is too slow (or fast), measure, compare and pick the one that works best for you. Yes, you can save JSON in a DB, an it will generally be faster than having separate files on the FS. But, again, benchmark and compare.
BTW, most J2EE 'approaches' (patterns) are overkill for any platform, let alone mobile.

Middleware design for mobile application

I am developing application for iPhone and android. In code i need to access the data from database(oracle) .
I am planning to use REST web services to return JSON data to devices. I dont know much about developing web servies(all i did is 'consumption' part).
Now the question came to my mind, i can still manage to return the JSON data from java servlets.
IS there any advantage of using web services. I know for sure I am missing something but want to know what is it.
Now the question came to my mind, i can still manage to return the JSON data from java servlets.
Yes, you can return JSON from java servlets. There are plenty of libraries out there for taking what ever data you've retrieved from you database and serializing it into JSON.
IS there any advantage of using web services. I know for sure I am missing something but want to know what is it.
This is a super general question, but yes. I think the best answer is that (among other things) it gives you an API that arbitrary clients can plug into. So you can expand to new platforms trivial. That's the main benefit as far I see it.

Categories

Resources