Coder Social home page Coder Social logo

fasttrack's Introduction

FastTrack

A basic android app skeleton, completely ready to use as a basement for your every new android project. It also contains some general routines and base methods and classes to help you spend more time on your original app idea and not on every-app routine tasks.

What's inside

  • Pre-configured IntelliJ project, ready to open and develop.

  • Pre-configured ant build script with some anchancements for automatic version name/code imprinting into manifest

  • Pre-linked most commonly used library projects:

    • ActionBarSherlock
    • ActionBar Pull To Refresh
    • ActionBar ViewPageIndicator
    • Android MenuDrawer
    • StickyListHeaders
    • GooglePlay Services
  • Base activity class (extends SherlockFragmentActivity) with a set of convenient methods for:

    • Various message and input dialogs
    • Progress dialog
    • Simplified Android action bar normal and action mode menus management
    • Local (in-process only) broadcast send/receive methods
  • Application class with a set of useful methods:

    • Place to put long initializing application code to run in background
    • Methods to wait for your application to initialize + pre-build SplashActivity
    • Mthods to send private broadcatsts
  • Utility classes in .utils package:

    • UIAsyncTask to run long running tasks with extended interation with the activity and dead activity protection

Usage

  • Download the .zip copy of repository
  • Unzip and open unzipped-folder/project in IntelliJ IDEA as a regualr project
  • Use IDEA's refactoring capabilities to change package name to one you want
  • Enjoy :)

Recommended way to work

  • Make sure your activities are extending BaseActivity

  • App initialization:

    • Place your long to initialize startup code into App.onInitializeAppInBackground() method to be executed in a separate thread
    • Use App.waitForApplication(...) method to wait while your app intizalization (including your code above) completes
  • Use applicationa and contexts for any place of your code:

    • App.getContext();
    • App.getApplication();
    • App.getDialogContext() - to receive current activi activity context (needed for input/message dialogs)
  • Ensure your activities are extending BaseActivity and presenting required information in abstract methods, you'll be forced to implement:

    • getActivityLayoutResource() - provide layout resource ID for automatic inflation or 0 to control this manually
    • getActionBarItemsMenuResource() - provide menu resource ID for an activity menu (action bar buttons)
    • getActionBarActionModeMenuResource() - provide menu resource ID for action bar ActionMode or 0 if you do not want to support action mode in this activity
    • onActionBarItemsStateUpdate() - use this method to change visivility/enabled state of your action bar menu items
    • onActionBarActionModeStarted() - called when action mode is started. Use to adjust visibility/enabled state of action mode menu items
    • onActionBarActionModeStopped() - called when action mode is ended
    • onActionBarItemSelected() - called when regular acrion bar menu item is selected. Return false to let system handle it for you.
    • onActionBarActionModeItemSelected() - called when action mode action bar item is selected. Return false to let system handle it for you.
    • use UIAsyncTask for running background tasks with feedback to UI - the progress dialog will be shown/removed automatically for you as well as error handling.
  • To control action bar action mode just call one of:

    • startActionMode() to start action mode. No other configuration requred !
    • finishActionMode() to end action mode at any time.
    • toggleActionMode() to toggle action mode at any time.
  • To let your activity receive local broadcasts:

    • enablePrivateBroadcastsReceiver(...) to enable local broadcast listener for the specified intent filter
    • disablePrivateBroadcastsReceiver() to disable local broadcast listener for activity. Automatically disabled on activity death.
    • override onPrivateBroadcastReceived(...) method to handle received local broadcast
    • use static App.registerPrivateBroadcastReceiver(...) / App.unregisterPrivateBroadcastReceiver(...) methods to register other listeners for private broadcasts
  • To send a local broadcast:

    • App.sendPrivateBroadcast(...) - completely async, like normal Context.sendBroadcast
    • App.sendPrivateBroadcastAndWait(...) - method will be blocked until all broadcast receivers will process request

Ant

Ant build script contains a custom rules file, which is automatically imported and used by ant. This adds the following features to your ant build process:

  • version name and version code from version.propeties file are automatically inserted into AndroidManifest.xml on build.
  • when app.debuggable property set to "true" in (version.properties), the folowing extra actions will tak place:
    • android:debuggable="true" is set to AndroidManifest.xml
    • proguard will be disabled

And once app.debuggable is removed or set to "false", android:debuggable="true" statement will be automatically removed and proguard obfuscation is enabled.

Soon

  • A web app for preparing personalized project with your color scheme, package name, app icon and several more googies is coming soon, staytuned.
  • More detailed documentation to come, this is just version 0.1 :)

fasttrack's People

Contributors

livotov avatar askerov avatar

Watchers

James Cloos avatar WangLin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.