I'm looking at writing an app which will use text present on a user's device to generate other text - ie, read through all SMSs on the device, parse this somehow, then do something with this data (ie, a word-cloud of common phrases or similar).
I see there is a way to access the SMSs on the device, but it looks a little ropey:
Android 2.2 Read SMS Inbox messages
Are there other ways? I think I read somewhere that this would fail on some devices - any info on that? Any suggestions for other sources of (text) data which I could consider pulling from?
Thanks
Unfortunately for you, using a content provider is the only way to access text messages on android. You should do some more research though. I think once you get more comfortable with the ContentProvider interface it will feel pretty easy. In fact, I recommend you read this article in the android documentation about ContentProviders. Perhaps that will help you.
Related
I'm trying to program an app using android studio that receives data (blood sugar levels) from the app tomato (which calculates blood sugar levels automatically every 5 mins or so). The tomato app already exists and is made by a company.
So I was wondering if doing this is possible. if so, how?
I saw this post: Is it possible for an Android app to use data from another app? which is very similar to what im trying to do but i didnt find an exact solution/answer to this.
Any opinions and help are very much needed and welcomed.
You would first need to know how the app is storing the data, you could check your phone's storage using the Device File Explorer in Android Studio. If they have exposed the data then you are able to check and read the files that the app has exposed. However, I have a feeling that they would not be leaving them in plain text for you to take.
Upon some further reading, it seems they read from a device called a MiaoMiao Transmitter. You could ask the producer of this product for a developer kit and see what they say. This would come with documentation as to how you can get data from the product. However, if they do not provide you with any help, you will need to do some investigation as to how the device functions.
Perhaps it sends android broadcasts when it is taking a reading? This is just speculation of course. This is very niche and I believe that is a reason there are only a few apps that use the device - they are trying to lock out "non-verified" developers. However, when there is a will, there is always a way! ;)
Best of luck!
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.
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.
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.
my android application is handling a large database of bus passage time and we would like to allow others application to be able to display certains bus passage time. We would like to use a content provider to do that. Most example seems to be about using an SQL database, but... we use some custom text file. I was wondering what would be the best way to do that. I was thinking I could use a Content Provider and implement the Cursor interface on a custom object that I would manually fill with my text data. Would this be possible ? Anyone have a better idea (excluding changing to SQL lite of course) ?
Thanks in advance.
Would this be possible ?
Sure. ConetntProvider is, in effect, a facade, not dictating all that much about the internal implementation.
The key will be documentation. If you are not using SQLite as a data store, you most likely will not be supporting full WHERE clauses for query() and such. Hence, you need to make sure that whatever you do support for WHERE clauses, available columns, and the like, you document it well, so developers integrating with your content provider know how to do it. Otherwise, they may make faulty assumptions.