Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Sessions, databases and Parse.com

I almost finished the android chapters and I'm sad there are only 2 :(

I wanted to to some general questions about what I can do with Android apps:

  1. Is it possible to have sessions and connect to databases like in PHP but within an Android app? Let's say I have a website with a couple of users and each user has some unique info. Can I login and access/change that info within an android app?

  2. I've seen some posts and workshops that have info on Parse.com. Is this the platform to use to accomplish the above? There are no others? I can't just use normal hosting to work with apps like I work with websites?

Well basically that's it. It would be nice to have an answer to these generic questions and it's a shame that someone needs to have a gold account to have access to some knowledge on Parse.com and it's benefits.

(Please note that I don't have a gold account and I have very limited access to workshops. Just 30 secs or so...)

2 Answers

you can make a parse.com account and view the android documentation. The documentation is quite good and its fairly easy to get up and running.

They have a quickstart guide whenever you first create a parse app after you sign up that shows you how to include parse into your project. I havent done or watched any of the android videos, but I imagine the process is similar to iOS and it wasnt too hard.

Parse makes it very easy to implement the concept of users, in the case of iOS its only a few method calls. YMMV with android however

I will do it soon. But with Parse.com you can comunicate easily with your normal web host? Or you are "forced" to host your app with Parse.com? I just wanted to know how far can I go and what are the proper tools to use. The more control I have the better.

you have to host the app on parse. They have a free account version which works fine for testing, but it has data limitations which make it ill suited for production. There are several other companies like parse (stackmob is another popular one) , but parse is VERY easy to use.

I cant say anything about using your normal webhost since I have never tried.

And you can easily share information across parse.com and your website? Let's say you have an app that would store some information of users but the users could also access that info on a desktop. Is that something achievable by those platforms such as parse.com?

I havent worked with it, but check out https://parse.com/docs/js_guide#javascript_guide

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

I'm working on the next Android project with Parse as I type this! It should hopefully help, though I'm sorry it's not ready yet.

If you have your own backend then there is no need to put Parse in the middle. Parse is a great way to set up a simple backend from scratch, as well as some other cool features.

How do you login to your PHP site? You should be able to login through an Android app pretty easily. If you allow Basic authentication then I have a gist on GitHub that might help. It does the login work on a background thread and requires a Handler be passed in, which is fairly straightforward if you haven't done it before.

Anyhow, you also need to see how your web app presents data. Are there any APIs to call? How is the data returned? Is it all in HTML pages or can you get at raw data somehow?