Skip to content

rayelward/snotg_package

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social Networking on the Go.

Project Setup

SNotG Environment Setup and Administration

Setting up the Android Environment

  1. Install android SDK, you can find it at this link: http://developer.android.com/sdk/index.html
  2. Make sure you have Eclipse 3.6 or newer
  3. Next we need to set up the ADT plugin in eclipse, so open eclipse select “Help” and click “install new software…”, click Add, in the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location: https://dl-ssl.google.com/android/eclipse/ then click OK, and install the add-ons that come with it, when installation is complete restart eclipse.
  4. Select Window > Preferences... to open the Preferences panel (Mac OS X: Eclipse > Preferences).
  5. Select Android from the left panel. You may see a dialog asking whether you want to send usage statistics to Google. If so, make your choice and click Proceed. You cannot continue with this procedure until you click Proceed.
  6. For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory.
  7. Click Apply, then OK.
  8. Go to Windows, click on Andriod SDK manager, can either select all and install them or just the version we need for our app witch is the 2.3.3 (API 10)
  9. There is a great perspective called DDMS for debugging with both the emulator and device. This comes with the ADT. From Eclipse: Click Window > Open Perspective > Other... > DDMS Setting up the code and projects There are three projects:
  10. snotg_web_gae - This is the Google App Engine project containing the back-end services
  11. snotg_android - This is the Android device project
  12. snotg_android_test - This is the Android JUnit test project. JUnit tests will not run in an Android project and requires a separate test project. Android unit testing is still very “green”. We did very little automated unit testing. This project is not required to run the app. The source code is currently in DePaul’s SVN repository svn://apollo.cti.depaul.edu/SNotG.
    A zip of these projects is also made publicly available on GITHub: https://github.com/rayelward/snotg_package . Download the projects and unzip them. Then import them into Eclipse as projects.

Following are screen captures showing the required libraries in Eclipse:

See screenshots at:

https://docs.google.com/document/d/1E1F2A2AVYp7ES3nzAs4P19c8LL8Fx8UYQnpQELkC_-8/edit

How to administer Google App Engine

  1. Locally, start the GAE project. Go to url: http://localhost:8888/_ah/admin/

  2. In the cloud, https://appengine.google.com/start

    a. The snotg_web_gae project represents the service running on the Google App Engine, In order to deploy it to GAE you will need to right click on the project and go to google and click deploy to app engine (You will need to provide a gmail login)

    b. IMPORTANT: LOOK for the Google icon in the lower-left of the Eclipse ide. It will either say, ‘Not Connected’ or name the account you are currently logged-in as. You must be logged-in as ‘se491snotg’ in order to deploy the app in the cloud. Right-click to change login.

    c. There are two instances of the clould GAE under the se491snotg Google account: se491snot.appstore.com, se491snotg-2.appstore.com. This is important to configure the one you want to run against in the Android strings.xml for the android app. Running Locally - one time setup Create a map key: Look this up on the web. You have to create a development map key for your machine in order to use mapping on the emulator. This is simple and well-documented on the web. Look this up how to do it. Creating a Google Account for the emulator: You will need to create a Google account or accounts on the emulator to test with. This is done the exact same way as with a real android device. Look this up on the web if unsure.
    NEXT, it is important to save this emulator profile so it is not lost every time the emulator is restarted.
    In a nutshell:

  3. Start the emulator. BUT, in start dialog uncheck the 'Save to snapshot..." checkbox. Make sure "Launch from snapshot" is checked.

  4. Add account as you would expect to emulator

  5. Save the emulator profile. To do this, telnet to the emulator and run adv tool (e.g. with putty) $ telnet localhost 5554

Trying 127.0.0.1...

Connected to localhost.

Android Console: type 'help' for a list of commands

OK avd snapshot save foo

  1. That's it. Next time when starting the emulator, make sure the 'Launch from snapshot' is checked and your account will still be setup. If this is not done, you will lose the account setup every time the emulator is restarted.

Here is a good link describing more detail: http://stackoverflow.com/questions/4842612/how-do-you-save-android-emulator-snapshot

Running Locally

Point android a GAE instance:

You can run the app locally either on the emulator or a tethered device. You can point these to either the local GAE running or the cloud. Which GAE back-end service to use must be defined in the android strings.xml. This tells android where to connect. To run in the cloud: se491snotg.appspot.com 80 To run using the local GAE: 10.0.0.2 8888 ***NOTE: 10.0.0.2 is the machine localhost from INSIDE the emulator

Seed test data in the GAE:

The GAE needs test data in order to run. Servlets exist to do this. Run the admin jsp below. There is a link to populate data for the user and user_profile tables. There is a separate link for the user_location table. The default page (index.html) for the GAE is a useful page that has links to services to populate dummy data and other relevant admin functionalities.

a.	These are:  localhost:8888

b.	http://se491snotg-1.appspot.com/  and http://se491snotg.appspot.com/

Running the Android app:

  1. Need to set up the emulator first, so open eclipse and go to window and click AVD manager, then click new and add a new android device making sure the platform is 2.3.3 (API 10).
  2. Then right click on SNOTG_android project and click run as android application, you should see the emulator opening and start loading up with the app.
  3. When the app opens you’ll see a login screen. Choose the account to authenticate with.
  4. After you login you will have 4 tabs that you can use, The screen should open up to the second tab called “Maps” where you can begin to use all the functionality within the app. a. Set the emulator location from the eclipse DDMS or command line. If this is not done, the emulator location is (0,0) out in the Atlantic ocean and will never have Nearby Users

Miscellaneous “Gotchas”

SNotG is only in its first release and there are still some config dependencies that if not in place can cause confusing errors. These come from the manually seeding the data. Often if this gets in a bad state, can cause problems. Here are some miscellaneous errors that can arise and how to resolve them.

  1. When on the map and double-clicking a user pushpin to see their shout and a Json parsing error results, one should verify:

    a. user and user_profile table entry exists for the user. If these are missing, it will cause an error.

  2. If running the emulator and wanting to test the map functionality:

    a. Set the emulator location from the eclipse DDMS or command line. If this is not done, the emulator location is (0,0) out in the Atlantic ocean and will never have Nearby Users

    b. Make sure dummy location data is seeded and exists. Remember there is a 5 minute expiration for user locations. So, after seeding, in 5 minutes they will get removed by the GAE clean-up job and you won’t have near by users

  3. IF no map shows up in the emulator (you only see a grid with grey background), make sure a proper dev map key exists for your machine and this key is set in the strings.xml file of the android project.

  4. Any exceptions on android when selecting users on the map or clicking the balloon to chat, VERIFY that the user exists in the User and User Profile tables. This is a common error when changing dummy data.

  5. Development can be done without an internet connection by running the local GAE instance and using the emulator or tethering a device.

About

DePaul University SE591 project - social network on the go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages