Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

Set up your Todo.txt for Android development environment with Eclipse

techraf edited this page Aug 2, 2014 · 6 revisions

Interested in learning Android development? Todo.txt for Android is a simple, fun app to hack on, and all the source code is available right here on GitHub, with a community of developers and users available to answer questions via email and on IRC. Once you've worked your way through the Hello World Android tutorial, try grabbing the Todo.txt code and running it in the Android emulator.

How to Get Started

It is important that you follow these steps exactly and perform the clone as a separate step outside of Eclipse and then create the project as described below. To clone the project directly from within Eclipse may cause problems that cannot be easily resolved.

  1. install Eclipse and the Android SDK if you have not already done so.
  2. fork and clone the todo.txt-android repository.
  3. Create a new Android project in Eclipse:
  • File->New Project->Android->Android Project from Existing Code.
  • Tick Create project from existing source and set the location to the folder where you saved the source code.
  1. Create a Dropbox Api Key and add it to the project. See next sections.

Create your Dropbox Api Key

Initially, the todo.txt-android project will not compile. Do the following to correct any errors and get ready to develop:

  1. Log into the Dropbox Developers Section.
  2. Click the "Create App" button.
  3. Select
  • "Dropbox API App" ->
  • "Files and datastores" ->
  • "No - My app needs access to files already on Dropbox" ->
  • "Specific file types - My app only needs access to certain file types, like text or photos" ->
  • "Text files TXT, Markdown, Code files, HTML, etc."`.
  1. Enter a name like "My Awesome Todo.txt fork"
  2. Click the "Create App" button.

You should now see your own personal App key and App secret displayed on the ensuing page. You'll need these for the next step.

Add Api key to the project

  1. Copy \res\values\sample-dropbox.xml file to \res\values\dropbox.xml.
  2. Edit \res\values\dropbox.xml.
  • Replace Enter your Dropbox app key here with db- followed by your Dropbox App key.
  • Replace Enter your Dropbox app secret here with your Dropbox App secret.
  • Uncomment out those lines.

It is very important that your App key is prepended with db- in the dropbox.xml file. Otherwise, the app will crash when you attempt to Log in.

Code Style

Always use Control+Shift+F to format your files. To prevent Eclipse from re-formatting XML file license header blocks, uncheck the "Join Lines" feature under Preferences->XML->XML Files->Editor.