Skip to content

Instantly share code, notes, and snippets.

@cakesmith
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save cakesmith/afe3a191d6f361ce17fc to your computer and use it in GitHub Desktop.

Select an option

Save cakesmith/afe3a191d6f361ce17fc to your computer and use it in GitHub Desktop.
Configuring ionic

#Configuring ionic framework for android ##on 64 bit crunchbang, need to install jdk and 32 bit libraries for android:

  • sudo apt-get install ant openjdk-7-jdk lib32sdc++6 lib32z1

  • install 64 bit android-sdk-linux

  • cd ~/android-sdk-linux/tools

  • ./android update sdk --no-ui

  • ./android

    • add tools, platform-tools, build-tools, EABI system images, etc
  • ./android avd and create an avd

  • update PATH and environment variables

    • add this to ~/.profile:

Add android development platform environment variables and path

if [ -d "$HOME/android-sdk-linux" ] ; then ANDROID_HOME="$HOME/android-sdk-linux/" ANDROID_PLATFORM_TOOLS="$HOME/android-sdk-linux/platform-tools/" ANDROID_TOOLS="$HOME/android-sdk-linux/tools/" PATH="$ANDROID_HOME:$ANDROID_TOOLS:$ANDROID_PLATFORM_TOOLS:$PATH:" fi

  - `source ~/.profile`

- `sudo npm install -g bower ionic cordova'

- `ionic create myApp`

- `cd myApp`

- 'npm install && ionic platform add android`

- `ionic emulate android`

- Profit.

To hot update:

- `ionic build && adb install -r platforms/android/ant-build/AppName-debug.apk`

## To add [ngCordova](http://ngcordova.com)

`bower install --save ngCordova`

then add this line before including the corvoda script
```html
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<script src="cordova.js"></script>

add to index.html:

<!-- Firebase -->
<script src="https://cdn.firebase.com/js/client/1.0.17/firebase.js"></script>
<!-- AngularFire Library -->
<script src="https://cdn.firebase.com/libs/angularfire/0.7.1/angularfire.min.js"></script>

add to js:

 var myApp = angular.module("MyApp", ["firebase"]);
 
function MyController($scope, $firebase) {
var peopleRef = new Firebase("https://<my-firebase>.firebaseio.com/people");
// Automatically syncs everywhere in realtime
$scope.people = $firebase(peopleRef);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment