android-programming-on-linux
| rev 41 | rev 42 | ||||
|---|---|---|---|---|---|
| 188 | https://github.com/banshee/AndroidProguardScala | 188 | https://github.com/banshee/AndroidProguardScala | ||
| 189 | compiles only the parts of scala lib that your application needs. | 189 | compiles only the parts of scala lib that your application needs. | ||
| n | 190 | n | 190 | ||
| 191 | http://eed3si9n.com/tetrix-in-scala/index.html : | ||||
| 192 | tetris in scala step by step howto really in depth ! | ||||
| 193 | |||||
| 194 | http://eed3si9n.com/tetrix-in-scala/android.html | ||||
| 195 | port a scala tetris game to android using 'android', sbt, pfn/android-plugin | ||||
| > | , | ||||
| 196 | |||||
| 197 | |||||
| 198 | libGDX | ||||
| 199 | ========== | ||||
| 200 | |||||
| 201 | libGDX is a cross-platform Java game development framework based on OpenGL (ES) | ||||
| > | that works on Windows, Linux, Mac OS X, Android, your WebGL enabled browser and | ||||
| > | iOS. | ||||
| 202 | |||||
| 203 | https://github.com/libgdx/libgdx | ||||
| 204 | |||||
| 205 | https://github.com/libgdx/libgdx/wiki/ | ||||
| 206 | |||||
| 191 | https://github.com/libgdx/libgdx/wiki/Using-libgdx-with-Scala | 207 | https://github.com/libgdx/libgdx/wiki/Using-libgdx-with-Scala | ||
| 192 | describes how to use sbt (scala build tool and g8 to build android apps) | 208 | describes how to use sbt (scala build tool and g8 to build android apps) | ||
| 193 | 209 | ||||
| n | 194 | libGDX is a cross-platform Java game development framework based on OpenGL | n | ||
| 195 | (ES) that works on Windows, Linux, Mac OS X, Android, your WebGL enabled brows | ||||
| > | er and iOS. | ||||
| 196 | |||||
| 197 | http://www.badlogicgames.com/ : | 210 | http://www.badlogicgames.com/ : | ||
| 198 | Mario's game dev blog which is very active, he authored libGDX and builds lots | 211 | Mario's game dev blog which is very active, he authored libGDX and builds lots | ||
| > | of android games. | > | of android games. | ||
| 199 | 212 | ||||
| n | n | 213 | unofficial libGDX references | ||
| 214 | |||||
| 200 | http://raintomorrow.cc/post/70000607238/develop-games-in-scala-with-libgdx-getti | 215 | http://raintomorrow.cc/post/70000607238/develop-games-in-scala-with-libgdx-getti | ||
| > | ng-started : | > | ng-started : | ||
| 201 | develop games in scala with libgdx getting-started | 216 | develop games in scala with libgdx getting-started | ||
| 202 | 217 | ||||
| n | 203 | http://eed3si9n.com/tetrix-in-scala/index.html : | n | ||
| 204 | tetris in scala step by step howto | ||||
| 205 | 218 | ||||
| t | 206 | http://eed3si9n.com/tetrix-in-scala/android.html | t | 219 | |
| 207 | port a scala tetris game to android using 'android', sbt, pfn/android-plugin | ||||
| > | , | ||||
| 208 | 220 | ||||
| rev 40 | rev 41 | ||||
|---|---|---|---|---|---|
| 200 | http://raintomorrow.cc/post/70000607238/develop-games-in-scala-with-libgdx-getti | 200 | http://raintomorrow.cc/post/70000607238/develop-games-in-scala-with-libgdx-getti | ||
| > | ng-started : | > | ng-started : | ||
| 201 | develop games in scala with libgdx getting-started | 201 | develop games in scala with libgdx getting-started | ||
| t | t | 202 | |||
| 203 | http://eed3si9n.com/tetrix-in-scala/index.html : | ||||
| 204 | tetris in scala step by step howto | ||||
| 205 | |||||
| 206 | http://eed3si9n.com/tetrix-in-scala/android.html | ||||
| 207 | port a scala tetris game to android using 'android', sbt, pfn/android-plugin | ||||
| > | , | ||||
| 202 | 208 | ||||
| rev 39 | rev 40 | ||||
|---|---|---|---|---|---|
| 197 | http://www.badlogicgames.com/ : | 197 | http://www.badlogicgames.com/ : | ||
| 198 | Mario's game dev blog which is very active, he authored libGDX and builds lots | 198 | Mario's game dev blog which is very active, he authored libGDX and builds lots | ||
| > | of android games. | > | of android games. | ||
| t | t | 199 | |||
| 200 | http://raintomorrow.cc/post/70000607238/develop-games-in-scala-with-libgdx-getti | ||||
| > | ng-started : | ||||
| 201 | develop games in scala with libgdx getting-started | ||||
| 202 | |||||
| rev 38 | rev 39 | ||||
|---|---|---|---|---|---|
| 194 | libGDX is a cross-platform Java game development framework based on OpenGL | 194 | libGDX is a cross-platform Java game development framework based on OpenGL | ||
| 195 | (ES) that works on Windows, Linux, Mac OS X, Android, your WebGL enabled brows | 195 | (ES) that works on Windows, Linux, Mac OS X, Android, your WebGL enabled brows | ||
| > | er and iOS. | > | er and iOS. | ||
| t | t | 196 | |||
| 197 | http://www.badlogicgames.com/ : | ||||
| 198 | Mario's game dev blog which is very active, he authored libGDX and builds lots | ||||
| > | of android games. | ||||
| rev 37 | rev 38 | ||||
|---|---|---|---|---|---|
| 191 | https://github.com/libgdx/libgdx/wiki/Using-libgdx-with-Scala | 191 | https://github.com/libgdx/libgdx/wiki/Using-libgdx-with-Scala | ||
| 192 | describes how to use sbt (scala build tool and g8 to build android apps) | 192 | describes how to use sbt (scala build tool and g8 to build android apps) | ||
| t | t | 193 | |||
| 194 | libGDX is a cross-platform Java game development framework based on OpenGL | ||||
| 195 | (ES) that works on Windows, Linux, Mac OS X, Android, your WebGL enabled brows | ||||
| > | er and iOS. | ||||
| rev 36 | rev 37 | ||||
|---|---|---|---|---|---|
| 189 | compiles only the parts of scala lib that your application needs. | 189 | compiles only the parts of scala lib that your application needs. | ||
| 190 | 190 | ||||
| t | t | 191 | https://github.com/libgdx/libgdx/wiki/Using-libgdx-with-Scala | ||
| 192 | describes how to use sbt (scala build tool and g8 to build android apps) | ||||
| rev 35 | rev 36 | ||||
|---|---|---|---|---|---|
| 185 | http://scala-ide.org/docs/tutorials/androiddevelopment/index.html : | 185 | http://scala-ide.org/docs/tutorials/androiddevelopment/index.html : | ||
| 186 | andoir app development with scala | 186 | andoir app development with scala | ||
| t | t | 187 | |||
| 188 | https://github.com/banshee/AndroidProguardScala | ||||
| 189 | compiles only the parts of scala lib that your application needs. | ||||
| 190 | |||||
| rev 34 | rev 35 | ||||
|---|---|---|---|---|---|
| 183 | android app development with scala | 183 | android app development with scala | ||
| 184 | 184 | ||||
| t | t | 185 | http://scala-ide.org/docs/tutorials/androiddevelopment/index.html : | ||
| 186 | andoir app development with scala | ||||
| rev 33 | rev 34 | ||||
|---|---|---|---|---|---|
| 179 | http://scalandroid.blogspot.com/ : | 179 | http://scalandroid.blogspot.com/ : | ||
| 180 | game making blog scala android scawars devs used: maven progaurd scala | 180 | game making blog scala android scawars devs used: maven progaurd scala | ||
| t | t | 181 | |||
| 182 | http://www.drdobbs.com/mobile/developing-android-apps-with-scala-and-s/ : | ||||
| 183 | android app development with scala | ||||
| 181 | 184 | ||||
| rev 32 | rev 33 | ||||
|---|---|---|---|---|---|
| 178 | 178 | ||||
| 179 | http://scalandroid.blogspot.com/ : | 179 | http://scalandroid.blogspot.com/ : | ||
| t | 180 | game making blog | t | 180 | game making blog scala android scawars devs used: maven progaurd scala |
| 181 | 181 | ||||
| rev 31 | rev 32 | ||||
|---|---|---|---|---|---|
| 174 | =================== | 174 | =================== | ||
| 175 | 175 | ||||
| n | 176 | **https://github.com/dunnololda/scage** | n | 176 | https://github.com/dunnololda/scage : |
| 177 | game engine | 177 | game engine | ||
| 178 | 178 | ||||
| t | 179 | **http://scalandroid.blogspot.com/** | t | 179 | http://scalandroid.blogspot.com/ : |
| 180 | game making blog | 180 | game making blog | ||
| 181 | 181 | ||||
| rev 30 | rev 31 | ||||
|---|---|---|---|---|---|
| 169 | 169 | ||||
| 170 | might need sbt (scala build tools) | 170 | might need sbt (scala build tools) | ||
| t | t | 171 | |||
| 172 | |||||
| 173 | scala game engines | ||||
| 174 | =================== | ||||
| 175 | |||||
| 176 | **https://github.com/dunnololda/scage** | ||||
| 177 | game engine | ||||
| 178 | |||||
| 179 | **http://scalandroid.blogspot.com/** | ||||
| 180 | game making blog | ||||
| 181 | |||||
| rev 29 | rev 30 | ||||
|---|---|---|---|---|---|
| 161 | 161 | ||||
| 162 | # install | 162 | # install | ||
| t | 163 | sudo mv scala-2.10.3 /usr/share/scala | t | 163 | sudo mv scala-2.11.0 /usr/share/scala |
| 164 | sudo ln -s /usr/share/scala/bin/scala /usr/bin/scala | 164 | sudo ln -s /usr/share/scala/bin/scala /usr/bin/scala | ||
| 165 | sudo ln -s /usr/share/scala/bin/scalac /usr/bin/scalac | 165 | sudo ln -s /usr/share/scala/bin/scalac /usr/bin/scalac | ||
| rev 28 | rev 29 | ||||
|---|---|---|---|---|---|
| 152 | ==================== | 152 | ==================== | ||
| 153 | 153 | ||||
| n | 154 | Not directly related to Android development, but I plan to learn Scala (expand m | n | 154 | Not directly related to Android development, but I plan to learn Scala (expand m |
| > | y use of functional langs) while building android apps. | > | y use of functional langs) while building android apps. Replace version with la | ||
| > | test in the subsequent code block. | ||||
| 155 | 155 | ||||
| 156 | .. code-block:: bash | 156 | .. code-block:: bash | ||
| 157 | 157 | ||||
| 158 | # download & unzip | 158 | # download & unzip | ||
| t | 159 | wget http://www.scala-lang.org/files/archive/scala-2.10.3.tgz | t | 159 | wget hhttp://www.scala-lang.org/files/archive/scala-2.11.0.tgz |
| 160 | tar -xzvf scala-2.10.3.tgz | 160 | tar -xzvf scala-2.11.0.tgz | ||
| 161 | 161 | ||||
| 162 | # install | 162 | # install | ||
| rev 27 | rev 28 | ||||
|---|---|---|---|---|---|
| 148 | * click the 'Installed packages' tab | 148 | * click the 'Installed packages' tab | ||
| 149 | * click the 'Update All...' button | 149 | * click the 'Update All...' button | ||
| t | t | 150 | |||
| 151 | Installing Scala | ||||
| 152 | ==================== | ||||
| 153 | |||||
| 154 | Not directly related to Android development, but I plan to learn Scala (expand m | ||||
| > | y use of functional langs) while building android apps. | ||||
| 155 | |||||
| 156 | .. code-block:: bash | ||||
| 157 | |||||
| 158 | # download & unzip | ||||
| 159 | wget http://www.scala-lang.org/files/archive/scala-2.10.3.tgz | ||||
| 160 | tar -xzvf scala-2.10.3.tgz | ||||
| 161 | |||||
| 162 | # install | ||||
| 163 | sudo mv scala-2.10.3 /usr/share/scala | ||||
| 164 | sudo ln -s /usr/share/scala/bin/scala /usr/bin/scala | ||||
| 165 | sudo ln -s /usr/share/scala/bin/scalac /usr/bin/scalac | ||||
| 166 | sudo ln -s /usr/share/scala/bin/fsc /usr/bin/fsc | ||||
| 167 | sudo ln -s /usr/share/scala/bin/scaladoc /usr/bin/scaladoc | ||||
| 168 | sudo ln -s /usr/share/scala/bin/scalap /usr/bin/scalap | ||||
| 169 | |||||
| 170 | might need sbt (scala build tools) | ||||
| rev 26 | rev 27 | ||||
|---|---|---|---|---|---|
| 106 | 106 | ||||
| 107 | 107 | ||||
| n | 108 | Building in Debug Mode (Development) | n | 108 | Building in debug mode (development) |
| 109 | -------------------------------------------- | 109 | -------------------------------------------- | ||
| 110 | 110 | ||||
| 116 | ant debug | 116 | ant debug | ||
| 117 | 117 | ||||
| n | 118 | Install Debug application to emulator | n | 118 | Install debug application to emulator |
| 119 | --------------------------------------------- | 119 | --------------------------------------------- | ||
| 120 | 120 | ||||
| 139 | 139 | ||||
| 140 | 140 | ||||
| t | 141 | Update the Android SDK | t | 141 | How to update Android SDK |
| 142 | ========================================= | 142 | ========================================= | ||
| 143 | 143 | ||||
| rev 25 | rev 26 | ||||
|---|---|---|---|---|---|
| 86 | 86 | ||||
| 87 | 87 | ||||
| t | 88 | Building and Running from the Command Line | t | 88 | Building and running from the command line |
| 89 | ------------------------------------------------- | 89 | ------------------------------------------------- | ||
| 90 | 90 | ||||
| rev 24 | rev 25 | ||||
|---|---|---|---|---|---|
| 29 | 29 | ||||
| 30 | * optionally install eclipse | 30 | * optionally install eclipse | ||
| t | 31 | * create an android project | t | ||
| 32 | * create an ADV (android virtual device) | 31 | * create an ADV (android virtual device) emulator | ||
| 33 | 32 | ||||
| 34 | **Tip:** Add the platform-tools/ as well as the tools/ directory to your PATH en | 33 | **Tip:** Add the platform-tools/ as well as the tools/ directory to your PATH en | ||
| > | vironment variable. | > | vironment variable. | ||
| rev 23 | rev 24 | ||||
|---|---|---|---|---|---|
| 9 | * install the Java Development Kit (JDK) | 9 | * install the Java Development Kit (JDK) | ||
| 10 | 10 | ||||
| n | 11 | On Redhat or Fedora run the following:: | n | 11 | .. code-block:: bash |
| 12 | 12 | ||||
| n | n | 13 | # On Redhat or Fedora run the following | ||
| 14 | |||||
| 13 | yum install java-1.7.0-openjdk | 15 | yum install java-1.7.0-openjdk | ||
| 14 | yum install java-1.7.0-openjdk-devel | 16 | yum install java-1.7.0-openjdk-devel | ||
| 15 | 17 | ||||
| 16 | 18 | ||||
| 21 | * adjust your path environment variable | 23 | * adjust your path environment variable | ||
| 22 | 24 | ||||
| n | 23 | .. code-block:: bash | n | 25 | .. code-block:: bash |
| 24 | 26 | ||||
| t | 25 | # echo 'export PATH=$PATH:/home/fox/android/tools:/home/fox/android/platform-t | t | 27 | # echo 'export PATH=$PATH:/home/fox/android/tools:/home/fox/android/platform- |
| > | ools' >> ~/.bashrc | > | tools' >> ~/.bashrc | ||
| 26 | echo 'export PATH=$PATH:/path/to/android/tools' >> ~/.bashrc | 28 | echo 'export PATH=$PATH:/path/to/android/tools' >> ~/.bashrc | ||
| 27 | 29 | ||||
| 28 | * optionally install eclipse | 30 | * optionally install eclipse | ||
| rev 22 | rev 23 | ||||
|---|---|---|---|---|---|
| 4 | .. contents:: | 4 | .. contents:: | ||
| 5 | 5 | ||||
| n | 6 | * install java | n | 6 | Setup your development environment |
| 7 | =========================================== | ||||
| 8 | |||||
| 9 | * install the Java Development Kit (JDK) | ||||
| 10 | |||||
| 11 | On Redhat or Fedora run the following:: | ||||
| 12 | |||||
| 13 | yum install java-1.7.0-openjdk | ||||
| 14 | yum install java-1.7.0-openjdk-devel | ||||
| 15 | |||||
| 16 | |||||
| 7 | * install the android sdk:: | 17 | * install the android sdk:: | ||
| 8 | 18 | ||||
| 21 | 31 | ||||
| 22 | **Tip:** Add the platform-tools/ as well as the tools/ directory to your PATH en | 32 | **Tip:** Add the platform-tools/ as well as the tools/ directory to your PATH en | ||
| > | vironment variable. | > | vironment variable. | ||
| t | 23 | t | |||
| 24 | Install Java environment | ||||
| 25 | =============================== | ||||
| 26 | |||||
| 27 | We need the Java Development Kit (JDK). | ||||
| 28 | |||||
| 29 | Redhat or Fedora: | ||||
| 30 | |||||
| 31 | .. code-block:: bash | ||||
| 32 | |||||
| 33 | yum install java-1.7.0-openjdk | ||||
| 34 | yum install java-1.7.0-openjdk-devel | ||||
| 35 | 33 | ||||
| 36 | 34 | ||||
| rev 21 | rev 22 | ||||
|---|---|---|---|---|---|
| f | 1 | Android programming on Linux | f | 1 | Android programming on Linux |
| n | 2 | ================================= | n | 2 | ################################ |
| 3 | 3 | ||||
| 4 | .. contents:: | 4 | .. contents:: | ||
| 37 | 37 | ||||
| 38 | Create an android project on the cli | 38 | Create an android project on the cli | ||
| n | 39 | ---------------------------------------------------- | n | 39 | ========================================= |
| 40 | 40 | ||||
| 41 | reference: http://developer.android.com/guide/developing/projects/projects-cmdli | 41 | reference: http://developer.android.com/guide/developing/projects/projects-cmdli | ||
| > | ne.html | > | ne.html | ||
| 81 | 81 | ||||
| 82 | Programming the HelloWorld project | 82 | Programming the HelloWorld project | ||
| n | 83 | --------------------------------------------- | n | 83 | ========================================= |
| 84 | 84 | ||||
| 85 | modify your source code... | 85 | modify your source code... | ||
| 108 | 108 | ||||
| 109 | Building in Debug Mode (Development) | 109 | Building in Debug Mode (Development) | ||
| n | 110 | ########################################## | n | 110 | -------------------------------------------- |
| 111 | 111 | ||||
| 112 | #. Navigate to root of the project | 112 | #. Navigate to root of the project | ||
| 118 | 118 | ||||
| 119 | Install Debug application to emulator | 119 | Install Debug application to emulator | ||
| n | 120 | ########################################## | n | 120 | --------------------------------------------- |
| 121 | 121 | ||||
| 122 | #. Start your AVD (android Virtual Device) emulator. | 122 | #. Start your AVD (android Virtual Device) emulator. | ||
| 141 | 141 | ||||
| 142 | Update the Android SDK | 142 | Update the Android SDK | ||
| t | 143 | ################################ | t | 143 | ========================================= |
| 144 | 144 | ||||
| 145 | Periodically you may want to update your development environment, here's how: | 145 | Periodically you may want to update your development environment, here's how: | ||
| rev 20 | rev 21 | ||||
|---|---|---|---|---|---|
| 21 | 21 | ||||
| 22 | **Tip:** Add the platform-tools/ as well as the tools/ directory to your PATH en | 22 | **Tip:** Add the platform-tools/ as well as the tools/ directory to your PATH en | ||
| > | vironment variable. | > | vironment variable. | ||
| t | t | 23 | |||
| 24 | Install Java environment | ||||
| 25 | =============================== | ||||
| 26 | |||||
| 27 | We need the Java Development Kit (JDK). | ||||
| 28 | |||||
| 29 | Redhat or Fedora: | ||||
| 30 | |||||
| 31 | .. code-block:: bash | ||||
| 32 | |||||
| 33 | yum install java-1.7.0-openjdk | ||||
| 34 | yum install java-1.7.0-openjdk-devel | ||||
| 35 | |||||
| 36 | |||||
| 23 | 37 | ||||
| 24 | Create an android project on the cli | 38 | Create an android project on the cli | ||
| rev 19 | rev 20 | ||||
|---|---|---|---|---|---|
| 119 | adb -s emulator-5554 install ~/HelloWorld/bin/HelloWorld-debug.apk | 119 | adb -s emulator-5554 install ~/HelloWorld/bin/HelloWorld-debug.apk | ||
| 120 | 120 | ||||
| t | 121 | A top secret command for building in debug mode and deploying to a running emu | t | 121 | A top secret command for both building in debug mode and deploying to a runnin |
| > | lator use the following command: | > | g emulator use the following command: | ||
| 122 | 122 | ||||
| 123 | .. code-block:: bash | 123 | .. code-block:: bash | ||
| rev 18 | rev 19 | ||||
|---|---|---|---|---|---|
| 13 | .. code-block:: bash | 13 | .. code-block:: bash | ||
| 14 | 14 | ||||
| t | 15 | # echo 'export PATH=$PATH:/home/fox/android/tools' >> ~/.bashrc | t | 15 | # echo 'export PATH=$PATH:/home/fox/android/tools:/home/fox/android/platform-t |
| > | ools' >> ~/.bashrc | ||||
| 16 | echo 'export PATH=$PATH:/path/to/android/tools' >> ~/.bashrc | 16 | echo 'export PATH=$PATH:/path/to/android/tools' >> ~/.bashrc | ||
| 17 | 17 | ||||
| rev 17 | rev 18 | ||||
|---|---|---|---|---|---|
| 5 | 5 | ||||
| 6 | * install java | 6 | * install java | ||
| n | 7 | * install the android sdk | n | 7 | * install the android sdk:: |
| 8 | 8 | ||||
| n | n | 9 | http://developer.android.com/sdk/index.html | ||
| 10 | |||||
| 9 | - adjust your path environment variable | 11 | * adjust your path environment variable | ||
| 10 | 12 | ||||
| n | 11 | .. code-block:: bash | n | 13 | .. code-block:: bash |
| 12 | 14 | ||||
| t | 13 | # echo 'export PATH=$PATH:/home/fox/android/tools' >> ~/.bashrc | t | 15 | # echo 'export PATH=$PATH:/home/fox/android/tools' >> ~/.bashrc |
| 14 | echo 'export PATH=$PATH:/path/to/android/tools' >> ~/.bashrc | 16 | echo 'export PATH=$PATH:/path/to/android/tools' >> ~/.bashrc | ||
| 15 | 17 | ||||
| 16 | * optionally install eclipse | 18 | * optionally install eclipse | ||
| rev 16 | rev 17 | ||||
|---|---|---|---|---|---|
| 122 | 122 | ||||
| 123 | ant install | 123 | ant install | ||
| t | t | 124 | |||
| 125 | |||||
| 126 | Update the Android SDK | ||||
| 127 | ################################ | ||||
| 128 | |||||
| 129 | Periodically you may want to update your development environment, here's how: | ||||
| 130 | |||||
| 131 | * open a Terminal (ctrl+alt+t) | ||||
| 132 | * type 'android' and press enter | ||||
| 133 | * click the 'Installed packages' tab | ||||
| 134 | * click the 'Update All...' button | ||||
| rev 15 | rev 16 | ||||
|---|---|---|---|---|---|
| 8 | 8 | ||||
| 9 | - adjust your path environment variable | 9 | - adjust your path environment variable | ||
| t | t | 10 | |||
| 11 | .. code-block:: bash | ||||
| 12 | |||||
| 13 | # echo 'export PATH=$PATH:/home/fox/android/tools' >> ~/.bashrc | ||||
| 14 | echo 'export PATH=$PATH:/path/to/android/tools' >> ~/.bashrc | ||||
| 10 | 15 | ||||
| 11 | * optionally install eclipse | 16 | * optionally install eclipse | ||
| rev 14 | rev 15 | ||||
|---|---|---|---|---|---|
| 112 | adb -s emulator-5554 install ~/HelloWorld/bin/HelloWorld-debug.apk | 112 | adb -s emulator-5554 install ~/HelloWorld/bin/HelloWorld-debug.apk | ||
| 113 | 113 | ||||
| t | 114 | A top secret shortcut for development building and deploying to an emulator is | t | 114 | A top secret command for building in debug mode and deploying to a running emu |
| > | the following command | > | lator use the following command: | ||
| 115 | 115 | ||||
| 116 | .. code-block:: bash | 116 | .. code-block:: bash | ||
| rev 13 | rev 14 | ||||
|---|---|---|---|---|---|
| 106 | adb install ~/HelloWorld/bin/HelloWorld-debug.apk | 106 | adb install ~/HelloWorld/bin/HelloWorld-debug.apk | ||
| 107 | 107 | ||||
| n | 108 | You might need to specify the device serial which is found on the top of the vir | n | 108 | You might need to specify the device serial which is found on the top of the v |
| > | tual device titlebar. | > | irtual device titlebar. | ||
| 109 | 109 | ||||
| 110 | .. code-block:: bash | 110 | .. code-block:: bash | ||
| 111 | 111 | ||||
| 112 | adb -s emulator-5554 install ~/HelloWorld/bin/HelloWorld-debug.apk | 112 | adb -s emulator-5554 install ~/HelloWorld/bin/HelloWorld-debug.apk | ||
| t | t | 113 | |||
| 114 | A top secret shortcut for development building and deploying to an emulator is | ||||
| > | the following command | ||||
| 115 | |||||
| 116 | .. code-block:: bash | ||||
| 117 | |||||
| 118 | ant install | ||||
| rev 12 | rev 13 | ||||
|---|---|---|---|---|---|
| 106 | adb install ~/HelloWorld/bin/HelloWorld-debug.apk | 106 | adb install ~/HelloWorld/bin/HelloWorld-debug.apk | ||
| 107 | 107 | ||||
| t | 108 | You might need to specify the device serial. | t | 108 | You might need to specify the device serial which is found on the top of the vir |
| > | tual device titlebar. | ||||
| 109 | 109 | ||||
| 110 | .. code-block:: bash | 110 | .. code-block:: bash | ||
| rev 11 | rev 12 | ||||
|---|---|---|---|---|---|
| 100 | 100 | ||||
| 101 | #. Start your AVD (android Virtual Device) emulator. | 101 | #. Start your AVD (android Virtual Device) emulator. | ||
| n | 102 | #. Install your application using the adb script. | n | 102 | #. Install your application using the adb script which exists in the platform-to |
| > | ols/ directory of the SDK. | ||||
| 103 | 103 | ||||
| 104 | .. code-block:: bash | 104 | .. code-block:: bash | ||
| 105 | 105 | ||||
| 106 | adb install ~/HelloWorld/bin/HelloWorld-debug.apk | 106 | adb install ~/HelloWorld/bin/HelloWorld-debug.apk | ||
| t | t | 107 | |||
| 108 | You might need to specify the device serial. | ||||
| 109 | |||||
| 110 | .. code-block:: bash | ||||
| 111 | |||||
| 112 | adb -s emulator-5554 install ~/HelloWorld/bin/HelloWorld-debug.apk | ||||
| rev 10 | rev 11 | ||||
|---|---|---|---|---|---|
| 11 | * optionally install eclipse | 11 | * optionally install eclipse | ||
| 12 | * create an android project | 12 | * create an android project | ||
| n | 13 | * create an android virtual device | n | 13 | * create an ADV (android virtual device) |
| 14 | 14 | ||||
| 15 | **Tip:** Add the platform-tools/ as well as the tools/ directory to your PATH en | 15 | **Tip:** Add the platform-tools/ as well as the tools/ directory to your PATH en | ||
| > | vironment variable. | > | vironment variable. | ||
| 95 | 95 | ||||
| 96 | ant debug | 96 | ant debug | ||
| t | t | 97 | |||
| 98 | Install Debug application to emulator | ||||
| 99 | ########################################## | ||||
| 100 | |||||
| 101 | #. Start your AVD (android Virtual Device) emulator. | ||||
| 102 | #. Install your application using the adb script. | ||||
| 103 | |||||
| 104 | .. code-block:: bash | ||||
| 105 | |||||
| 106 | adb install ~/HelloWorld/bin/HelloWorld-debug.apk | ||||
| rev 9 | rev 10 | ||||
|---|---|---|---|---|---|
| f | 1 | Android programming on Linux | f | 1 | Android programming on Linux |
| 2 | ================================= | 2 | ================================= | ||
| t | t | 3 | |||
| 4 | .. contents:: | ||||
| 3 | 5 | ||||
| 4 | * install java | 6 | * install java | ||
| rev 8 | rev 9 | ||||
|---|---|---|---|---|---|
| 82 | In production (release mode) the SDK will not sign the .apk file, you will need | 82 | In production (release mode) the SDK will not sign the .apk file, you will need | ||
| > | to do this manually using the Keytool and Jarsigner. | > | to do this manually using the Keytool and Jarsigner. | ||
| 83 | 83 | ||||
| t | 84 | t | 84 | ||
| 85 | |||||
| 86 | Building in Debug Mode (Development) | ||||
| 87 | ########################################## | ||||
| 88 | |||||
| 89 | #. Navigate to root of the project | ||||
| 90 | #. Compile the project using Ant. | ||||
| 91 | |||||
| 92 | .. code-block:: bash | ||||
| 93 | |||||
| 94 | ant debug | ||||
| rev 7 | rev 8 | ||||
|---|---|---|---|---|---|
| 60 | --------------------------------------------- | 60 | --------------------------------------------- | ||
| 61 | 61 | ||||
| t | 62 | android create project \ | t | 62 | modify your source code... |
| 63 | --package com.example.helloworld \ | 63 | |||
| 64 | --activity HelloWorld \ | 64 | |||
| 65 | --target 3 \ | 65 | |||
| 66 | --path ~/HelloWorld | 66 | Building and Running from the Command Line | ||
| 67 | ------------------------------------------------- | ||||
| 68 | |||||
| 69 | Reference: http://developer.android.com/guide/developing/building/building-cmdli | ||||
| > | ne.html | ||||
| 70 | |||||
| 71 | The Ant script compiles and builds your project into a .apk file which may be in | ||||
| > | stalled on an emulator or device. | ||||
| 72 | |||||
| 73 | Ant provides the following two build modes: | ||||
| 74 | |||||
| 75 | * Test or Debug (Development) | ||||
| 76 | * Release (Production) | ||||
| 77 | |||||
| 78 | Regardless of the build mode chosen the application must be signed before it can | ||||
| > | be installed on an emulator or device. | ||||
| 79 | |||||
| 80 | In development (debug mode) the SDK will automatically sign your project with a | ||||
| > | development key. An application signed with a development key cannot be distrib | ||||
| > | uted. | ||||
| 81 | |||||
| 82 | In production (release mode) the SDK will not sign the .apk file, you will need | ||||
| > | to do this manually using the Keytool and Jarsigner. | ||||
| 83 | |||||
| 84 | |||||
| rev 6 | rev 7 | ||||
|---|---|---|---|---|---|
| 11 | * create an android virtual device | 11 | * create an android virtual device | ||
| 12 | 12 | ||||
| t | 13 | t | 13 | **Tip:** Add the platform-tools/ as well as the tools/ directory to your PATH en | |
| > | vironment variable. | ||||
| 14 | 14 | ||||
| 15 | Create an android project on the cli | 15 | Create an android project on the cli | ||
| rev 5 | rev 6 | ||||
|---|---|---|---|---|---|
| 18 | reference: http://developer.android.com/guide/developing/projects/projects-cmdli | 18 | reference: http://developer.android.com/guide/developing/projects/projects-cmdli | ||
| > | ne.html | > | ne.html | ||
| 19 | 19 | ||||
| n | 20 | The following cli command will create an android project skeleton named HelloAnd | n | 20 | The following cli command will create an android project skeleton named HelloWor |
| > | roid in your home directory. | > | ld in your home directory. | ||
| 21 | 21 | ||||
| 22 | .. code-block:: bash | 22 | .. code-block:: bash | ||
| 23 | 23 | ||||
| 24 | android create project \ | 24 | android create project \ | ||
| n | 25 | --package com.example.helloandroid \ | n | 25 | --package com.example.helloworld \ |
| 26 | --activity HelloAndroid \ | 26 | --activity HelloWorld \ | ||
| 27 | --target 3 \ | 27 | --target 3 \ | ||
| n | 28 | --path ~/HelloAndroid | n | 28 | --path ~/HelloWorld |
| 29 | 29 | ||||
| 30 | target | 30 | target | ||
| 56 | 56 | ||||
| 57 | This will follow the Java programming language standards. | 57 | This will follow the Java programming language standards. | ||
| t | t | 58 | |||
| 59 | Programming the HelloWorld project | ||||
| 60 | --------------------------------------------- | ||||
| 61 | |||||
| 62 | android create project \ | ||||
| 63 | --package com.example.helloworld \ | ||||
| 64 | --activity HelloWorld \ | ||||
| 65 | --target 3 \ | ||||
| 66 | --path ~/HelloWorld | ||||
| rev 4 | rev 5 | ||||
|---|---|---|---|---|---|
| 18 | reference: http://developer.android.com/guide/developing/projects/projects-cmdli | 18 | reference: http://developer.android.com/guide/developing/projects/projects-cmdli | ||
| > | ne.html | > | ne.html | ||
| 19 | 19 | ||||
| n | 20 | The cli command below will create an android project named HelloAndroid in your | n | 20 | The following cli command will create an android project skeleton named HelloAnd |
| > | home directory. | > | roid in your home directory. | ||
| 21 | 21 | ||||
| 22 | .. code-block:: bash | 22 | .. code-block:: bash | ||
| 25 | --package com.example.helloandroid \ | 25 | --package com.example.helloandroid \ | ||
| 26 | --activity HelloAndroid \ | 26 | --activity HelloAndroid \ | ||
| n | 27 | --target 2 \ | n | 27 | --target 3 \ |
| 28 | --path ~/HelloAndroid | 28 | --path ~/HelloAndroid | ||
| 29 | 29 | ||||
| t | 30 | Now if you navigate to ~/HelloAndroid you should see your project skeleton made | t | 30 | target |
| > | up of directories and files. | ||||
| 31 | The "build target" for your application. | ||||
| 32 | |||||
| 33 | This corresponds to an Android platform library (including any add-ons, such a | ||||
| > | s Google APIs) that you would like to build your project against. | ||||
| 34 | |||||
| 35 | To see a list of available targets and their corresponding IDs, **execute: and | ||||
| > | roid list targets.** | ||||
| 36 | |||||
| 37 | name | ||||
| 38 | The name for your project. | ||||
| 39 | |||||
| 40 | This is optional. If provided, this name will be used for your .apk filename w | ||||
| > | hen you build your application. | ||||
| 41 | |||||
| 42 | path | ||||
| 43 | The location of your project directory. | ||||
| 44 | |||||
| 45 | If the directory does not exist, it will be created for you. | ||||
| 46 | |||||
| 47 | activity | ||||
| 48 | The name for your default Activity class. | ||||
| 49 | |||||
| 50 | This class file will be created for you inside <path_to_your_project>/src/<you | ||||
| > | r_package_namespace_path>/ . | ||||
| 51 | |||||
| 52 | This will also be used for your .apk filename unless you provide a name. | ||||
| 53 | |||||
| 54 | package | ||||
| 55 | the package namespace for your project | ||||
| 56 | |||||
| 57 | This will follow the Java programming language standards. | ||||
| rev 3 | rev 4 | ||||
|---|---|---|---|---|---|
| 16 | ---------------------------------------------------- | 16 | ---------------------------------------------------- | ||
| 17 | 17 | ||||
| t | t | 18 | reference: http://developer.android.com/guide/developing/projects/projects-cmdli | ||
| > | ne.html | ||||
| 19 | |||||
| 18 | The cli command below will create an android project named HelloAndroid in your | 20 | The cli command below will create an android project named HelloAndroid in your | ||
| > | home directory. | > | home directory. | ||
| 19 | 21 | ||||
| rev 2 | rev 3 | ||||
|---|---|---|---|---|---|
| 26 | --path ~/HelloAndroid | 26 | --path ~/HelloAndroid | ||
| 27 | 27 | ||||
| t | t | 28 | Now if you navigate to ~/HelloAndroid you should see your project skeleton made | ||
| > | up of directories and files. | ||||
| rev 1 | rev 2 | ||||
|---|---|---|---|---|---|
| t | 1 | android programming on linux | t | 1 | Android programming on Linux |
| 2 | ================================= | 2 | ================================= | ||
| 3 | 3 | ||||
| empty | rev 1 | ||||
|---|---|---|---|---|---|
| t | t | 1 | android programming on linux | ||
| 2 | ================================= | ||||
| 3 | |||||
| 4 | * install java | ||||
| 5 | * install the android sdk | ||||
| 6 | |||||
| 7 | - adjust your path environment variable | ||||
| 8 | |||||
| 9 | * optionally install eclipse | ||||
| 10 | * create an android project | ||||
| 11 | * create an android virtual device | ||||
| 12 | |||||
| 13 | |||||
| 14 | |||||
| 15 | Create an android project on the cli | ||||
| 16 | ---------------------------------------------------- | ||||
| 17 | |||||
| 18 | The cli command below will create an android project named HelloAndroid in your | ||||
| > | home directory. | ||||
| 19 | |||||
| 20 | .. code-block:: bash | ||||
| 21 | |||||
| 22 | android create project \ | ||||
| 23 | --package com.example.helloandroid \ | ||||
| 24 | --activity HelloAndroid \ | ||||
| 25 | --target 2 \ | ||||
| 26 | --path ~/HelloAndroid | ||||
| 27 | |||||
Remarkbox