My favorites | Sign in
Project Home Wiki
Search
for
HostYourOwnServer  
A walkthrough on how to own your data
Featured, Phase-Implementation
Updated Aug 15, 2010 by foran.pa...@gmail.com

If, at any point, you need help, have questions, or get unexpected or unexplained errors, please don't hesitate to use the Google Group.

Pre-Requisites

Precautions

By installing your own server, you are affirming your understanding that updates to the Android application and/or Chrome extension may break your implementation. You should keep your server up to date at all times, as the way these component pieces pass information is liable to change.

Installing the server

  1. Create a new App Engine application; make a note of the ID (we'll reference that as app-id from now on)
  2. Extract/unzip the downloaded source to a convenient location
  3. Navigate to the location you extracted the source to in your console/terminal/shell
  4. Modify src/app.yaml to replace android2cloud with app-id
  5. Run the following command:
  6. python google_appengine/appcfg.py update src
  7. When the application finishes uploading, you will need to wait for App Engine to build the indexes. As soon as that is finished, your server is set up. To check the status of your indexes, log in to the control panel at http://appengine.google.com, choose app-id, and choose Datastore Indexes on the left. It will either say "Building" (not ready) or "Serving" (ready).

Configuring Android

  1. Open the application
  2. Select "Change Account"
  3. Select "Add Account"
  4. Enter an account name for Account
  5. Enter http://app-id.appspot.com (http:// is necessary, no trailing /) for Host
  6. Save
  7. Log in
  8. Grant access
  9. Select the new account

Configuring Chrome

Please note, Chrome's support for this is nearly nonexistent. That is my fault, and I'm working to remedy it. In the meantime, please forgive the numerous complicated steps below.

  1. Unzip the source archive to a permanent location
  2. Open manifest.json
  3. Change the server variable from "android2cloud.appspot.com" to "app-id.appspot.com"
  4. Change the consumer_key and consumer_secret to "anonymous"
  5. Save and close manifest.json
  6. Open background.html
  7. Change every instance of "android2cloud.appspot.com" with "app-id.appspot.com"
  8. Save and close background.html
  9. Open chrome://extensions
  10. Click "developer mode"
  11. Select "Load unpacked extension"
  12. Open the folder you unzipped the source to
  13. Authenticate when the window opens
Comment by jazmatic...@gmail.com, Aug 9, 2010

In background.html, you don't update every instance to your server, just the first one. That is, change where it says: var host = "android2cloud.appspot.com" to var host = "~insertYourAppIdHERE~.appspot.com"

The second one, 'consumer_key': "android2cloud.appspot.com", did not work unless I left it android2cloud. It looks like it's some sort of OAuth authorization. I'm pretty sure you want to leave that as-is. I'm not sure the "consumer_secret" should be in that file.

Comment by project member foran.pa...@gmail.com, Aug 15, 2010

Thanks for pointing that out. This was from before a re-factoring of the source code to make deploying a custom server a bit easier. The consumer_key and consumer_secret should actually be changed to "anonymous", technically. And unfortunately, the consumer_secret has to be included in the source. It's ok, though-- the app, according to OAuth spec, shouldn't be identified just by the consumer key or secret, so the security risk is minor.

Comment by mikehuds...@gmail.com, Sep 8, 2010

Step 6 of Configuring Android results in a failed call to "ah/OAuthGetRequestToken".

Comment by project member foran.pa...@gmail.com, Sep 10, 2010

Did you change app-id to your app's ID?

Comment by sal...@gmail.com, Sep 13, 2010

Can't get it to work with default settings, when I try to create a profile and press "save", nothing happens.

Comment by project member foran.pa...@gmail.com, Sep 16, 2010

Could you file a bug report? Thanks.

Comment by insideno...@gmail.com, Sep 21, 2010

Besides having to build python 2.5 using 'make altinstall' on centos which is running 2.4.x from the repo, the install went perfect and is working.

Comment by samisham...@gmail.com, Sep 24, 2010

I keep trying to run "python google_appengine/appcfg.py update src" in the Python interactive shell. I keep getting "syntax error". I've never used Python before. Do you have more detained instructions you can email me? I changed the app name in the src/app.yaml file but I'm have problems. Thanks.

Comment by sbwith...@gmail.com, Sep 25, 2010

Confirming jazmatic's suggestion. The Chrome extension onlyworks if you change only:

var host = "android2cloud.appspot.com" to 'yourappid.appspot.com'

..and do NOT change the "var oauth = ...." block of code.

Comment by sbwith...@gmail.com, Sep 25, 2010

samishamieh1: If you went down into the src folder, you need to come back up one level in the tree to run the python command. This is because 'google_appengine' isn't in the src folder. It's in the parent folder above. Run the command there.

I'm on Ubuntu Linux v10.4 (Lucid Lynx) 64-bit

Comment by sbwith...@gmail.com, Sep 25, 2010

This works really well. I set up my own server, re-packed the extension and emailed it to my gmail account so I can easily install it on any Chrome system I use. I also tried it with 3 PCs in the same room and they all loaded the same page from my phone at the same time.

Comment by samisham...@gmail.com, Sep 25, 2010

I finally got it working. FYI, There's an error in the instructions. The consumer_key and consumer_secret text is in the Background.html file, not the manifest.json file. Thank you sbwithers!

Comment by lear...@gmail.com, Oct 6, 2010

Great app. Works well. Much appreciation. Thank you.

Comment by jackenne...@gmail.com, Oct 6, 2010

Confirming jazmatic and sbwithers. Otherwise the OAuth page hangs on “Redirecting.”

Comment by ja...@jamesking.co.uk, Oct 20, 2010

Step 6 of Configuring Android results in a failed call to "ah/OAuthGetRequestToken"

I am now getting the above problem. :(

Comment by project member foran.pa...@gmail.com, Oct 20, 2010

James, can you share what you're entering in the field?

Comment by ja...@jamesking.co.uk, Oct 20, 2010

sure.

I am hoping you've got an email now with the info :)

I am getting a similar problem where it is hanging on the Chrome extension "Redirecting" page.

Comment by ja...@jamesking.co.uk, Oct 20, 2010

I re-did it, but when creating the Google app engine app, I chose open to everyone, rather than only people on my domain. This appears to work with the android app. Now to try with the chrome extension. :)

Comment by ja...@jamesking.co.uk, Oct 20, 2010

Now seems to be working :-)

I take it that if you update the server software I will just need to download the source and do something similar to update my own server?

Thanks.

James

Comment by project member foran.pa...@gmail.com, Oct 20, 2010

Sorry for the confusion and problems. It appears we have a bug on Apps domains. I'll have to look into that.

As for updating, you'll just have to download the source, change the app.yaml identifier again, and run appcfg.py update. :)

Comment by fernand...@gmail.com, Nov 18, 2010

Works like a charm..

My server is up and running!!!

Thank you very much

Comment by chansiuf...@gmail.com, Dec 6, 2010

Using Samsung galaxy GT-I9000 ZSJPE 2.2 (Hong Kong), SpeedMod?- K9a-500Hz Stuck at the web page at "/ ah/OAuthGetRequestToken" unavailable page. And I really cant follow the "Installing the Server step" Could someone please help me?

Comment by project member foran.pa...@gmail.com, Dec 6, 2010

chansiufai12321, how can I help you? Getting stuck at that web page means that, for whatever reason, your Host field wasn't stored correctly. Could you tell me what you entered in the fields when adding your account?

Where are you getting lost on the instructions for Installing the Server?

Comment by chansiuf...@gmail.com, Dec 6, 2010

thx for your speedy reply first. I typed "chansiufai12321@gmail.com" as the Account and the default host "http://adroid2cloud.appspot.com" After I click "Save", it just shows WEB PAGE NOT AVAILABLE.

For the instructions installing the server, i dont really know why i have to install a new application server instead of using the application downloaded from the market. Also, I dont know where are the files you talking about are located, and dont know how to use the python to type in the commands as well.

Comment by project member foran.pa...@gmail.com, Dec 6, 2010

Sounds like there's some confusion here. You don't need to install a server at all; the option is there if you want to own your own data, or customise the server, however. Most people just use the public server.

As for the Web Page Not Available, it sounds like you're running into the problem where the Host field, for whatever reason, isn't getting saved. I'm going to try and debug this, and I'll probably end up issuing the fix when we switch over to the new server implementation.

Sorry you're having issues.

Comment by chansiuf...@gmail.com, Dec 6, 2010

It's alright. Never mind. But I was curious about the mechanism behind your app. How does it work? Where do the (possible) problems come from?

Comment by project member foran.pa...@gmail.com, Dec 6, 2010

The app, right now, just authenticates with OAuth, then stores a link in a database on the server. The extension loads a page from the server every fifteen seconds that will display the latest link of the logged in user. If the link matches the one in the extension's database, nothing happens, and it checks again in fifteen seconds. Otherwise, it opens a tab with the link in it, and checks again in fifteen seconds.

We're modifying this slightly with the new server architecture (coming soon!) but the basic idea stays the same. :)

As for where the problems come from, the one you were running into comes from the code that's handling storing your account credentials on the phone. I can't say specifically where it was coming from or what was causing it (if I knew, I'd have fixed it ;) ) but that seems to be the general area of the issue.

Out of curiosity, how did you manage to get it working?

Comment by chansiuf...@gmail.com, Dec 6, 2010

Out of curiosity, how did you manage to get it working?

??sorry My English is poor, I cant get your meaning...

Comment by project member foran.pa...@gmail.com, Dec 6, 2010

Not a problem. You said nevermind-- does that mean that the app now works for you? Your problem is fixed? What did you do to fix it?

Comment by chansiuf...@gmail.com, Dec 6, 2010

... Again, sorry for my poor English. I meant you dont need to feel sorry about the issue. By the way, the problem wasnt fixed.

Comment by project member foran.pa...@gmail.com, Dec 6, 2010

Not a problem. Sorry for the confusion.

I'll try to remember to update here if we find a solution for it.

Comment by patrickkajirian, Jan 6, 2011

Paddy, is the python update command "python google_appengine/appcfg.py update src" still valid for android2cloud 2.0.1 App Engine server? It doesn't work for me. Any suggestions? Do these instructions need to be updated?

Comment by project member foran.pa...@gmail.com, Jan 7, 2011

The directions do need to be updated-- sorry, I haven't given them the love they deserve with all the problems 2.0.2 has been having.

To get it working, download the App Engine SDK: http://code.google.com/appengine/downloads.html

Then, download the App Engine source from our downloads page. Unzip it, and change app.yaml's first line to reflect your application id. Copy and paste the src folder into the App Engine SDK folder (so it's in the same folder as tools), then follow Google's instructions for uploading a project: http://code.google.com/appengine/docs/python/gettingstarted/uploading.html

Comment by patrickkajirian, Jan 7, 2011

Yep - that helped. Thanks Paddy!

Comment by mwaskow...@gmail.com, Jan 20, 2012

The Chrome extension source is not available :-/ can you update the link please

Comment by project member foran.pa...@gmail.com, Jan 22, 2012

Sorry for the confusion! This project site is actually deprecated--we've moved to Github. You can find out more at http://www.2cloudproject.com.

The new repositories are:

https://github.com/2cloud/AppEngine -- The server https://github.com/2cloud/Chrome -- The Chrome extension https://github.com/2cloud/android2cloud -- The Android app

They should have install instructions in the README file. :)

Sorry for the confusion!


Sign in to add a comment
Powered by Google Project Hosting