MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

Revision 21 as of 2016-09-16 21:19:26
  • Java
  • Android

Android

  • Get Android Studio Bundle https://dl.google.com/dl/android/studio/install/1.2.2.0/android-studio-bundle-141.1980579-windows.exe

  • Install with Next, Next .....
  • UI Theme Darcula

Android SDK linux command line tools

  • cd /opt
  • wget https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz

  • tar xvzf android-sdk_r24.4.1-linux.tgz
  • cd android-sdk-linux/tools
  • ./android list sdk

   1- Android SDK Tools, revision 25.1.7
   2- Android SDK Platform-tools, revision 24.0.2
   3- Android SDK Build-tools, revision 24.0.2
  13- SDK Platform Android 4.1.2, API 16, revision 5
  • ./android update sdk --no-ui --filter 1,2,3,13
  • cd ..
  • cd tools
  • ./android create project --target android-16 --name AndroidProj --path ~/tmp/androidProj/ --activity MyProject --package androidproj.test --gradle --gradle-version 1.1.0

  • 1.1.0 is the gradle plugin version
  • cd ~/tmp/androidProj

Project structure

.
|-- build.gradle
|-- gradle
|   `-- wrapper
|       |-- gradle-wrapper.jar
|       `-- gradle-wrapper.properties
|-- gradlew
|-- gradlew.bat
|-- local.properties
`-- src
    |-- androidTest
    |   `-- java
    |       `-- androidproj
    |           `-- test
    |               `-- MyProjectTest.java
    `-- main
        |-- AndroidManifest.xml
        |-- java
        |   `-- androidproj
        |       `-- test
        |           `-- MyProject.java
        `-- res
            |-- drawable-hdpi
            |   `-- ic_launcher.png
            |-- drawable-ldpi
            |   `-- ic_launcher.png
            |-- drawable-mdpi
            |   `-- ic_launcher.png
            |-- drawable-xhdpi
            |   `-- ic_launcher.png
            |-- layout
            |   `-- main.xml
            `-- values
                `-- strings.xml
  • vi gradle/wrapper/gradle-wrapper.properties # change version from 1.12 to 2.2.1
  • vi build.gradle # comment with // lines with Proguard
  • ./gradlew
  • ./gradlew tasks
  • ./gradlew clean build
  • find . -name "*.apk" # ./build/outputs/apk/androidProj-debug.apk

./build/outputs/apk/androidProj-debug.apk
./build/outputs/apk/androidProj-release-unsigned.apk
./build/outputs/apk/androidProj-debug-unaligned.apk

./src/androidTest/java/androidproj/test/MyProjectTest.java

   1 package androidproj.test;
   2 
   3 import android.test.ActivityInstrumentationTestCase2;
   4 
   5 /**
   6  * This is a simple framework for a test of an Application.  See
   7  * {@link android.test.ApplicationTestCase ApplicationTestCase} for more information on
   8  * how to write and extend Application tests.
   9  * <p/>
  10  * To run this test, you can type:
  11  * adb shell am instrument -w \
  12  * -e class androidproj.test.MyProjectTest \
  13  * androidproj.test.tests/android.test.InstrumentationTestRunner
  14  */
  15 public class MyProjectTest extends ActivityInstrumentationTestCase2<MyProject> {
  16 
  17     public MyProjectTest() {
  18         super("androidproj.test", MyProject.class);
  19     }
  20 
  21 }

./src/main/AndroidManifest.xml

   1 <?xml version="1.0" encoding="utf-8"?>
   2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
   3       package="androidproj.test"
   4       android:versionCode="1"
   5       android:versionName="1.0">
   6     <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
   7         <activity android:name="MyProject"
   8                   android:label="@string/app_name">
   9             <intent-filter>
  10                 <action android:name="android.intent.action.MAIN" />
  11                 <category android:name="android.intent.category.LAUNCHER" />
  12             </intent-filter>
  13         </activity>
  14     </application>
  15 </manifest>

./src/main/res/layout/main.xml

   1 <?xml version="1.0" encoding="utf-8"?>
   2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   3     android:orientation="vertical"
   4     android:layout_width="fill_parent"
   5     android:layout_height="fill_parent"
   6     >
   7 <TextView
   8     android:layout_width="fill_parent"
   9     android:layout_height="wrap_content"
  10     android:text="Hello World, MyProject"
  11     />
  12 </LinearLayout>

./src/main/res/values/strings.xml

   1 <?xml version="1.0" encoding="utf-8"?>
   2 <resources>
   3     <string name="app_name">MyProject</string>
   4 </resources>

./src/main/java/androidproj/test/MyProject.java

   1 package androidproj.test;
   2 
   3 import android.app.Activity;
   4 import android.os.Bundle;
   5 
   6 public class MyProject extends Activity
   7 {
   8     /** Called when the activity is first created. */
   9     @Override
  10     public void onCreate(Bundle savedInstanceState)
  11     {
  12         super.onCreate(savedInstanceState);
  13         setContentView(R.layout.main);
  14     }
  15 }

./build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'
    }
}
apply plugin: 'android'

android {
    compileSdkVersion 'android-16'
    buildToolsVersion '24.0.2'

    buildTypes {
        release {
            //runProguard false
            // proguardFile getDefaultProguardFile('proguard-android.txt')
        }
    }
}

./gradle/wrapper/gradle-wrapper.properties

#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip

Vodafone 785 Slackware

  • mtp-detect #after connecting phone on usb

libmtp version: 1.1.11

Listing raw device(s)
Device 0 (VID=1bbb and PID=0168) is a Alcatel 6030a.
   Found 1 device(s):
   Alcatel: 6030a (1bbb:0168) @ bus 1, dev 7
Attempting to connect device(s)
Android device detected, assigning default bug flags
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01