diff options
author | David Walter Seikel | 2014-06-11 01:25:53 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-06-11 01:25:53 +1000 |
commit | faabf404ec6064956a08e825bed5d91e51fbdbbb (patch) | |
tree | 4aee2014b62efc93c5ab46fd73dcde8d250d9aa0 | |
parent | Added .gitignore and LICENSE files. (diff) | |
download | toyboxInstaller-faabf404ec6064956a08e825bed5d91e51fbdbbb.zip toyboxInstaller-faabf404ec6064956a08e825bed5d91e51fbdbbb.tar.gz toyboxInstaller-faabf404ec6064956a08e825bed5d91e51fbdbbb.tar.bz2 toyboxInstaller-faabf404ec6064956a08e825bed5d91e51fbdbbb.tar.xz |
Roughed out a skeleton of the UI.
-rw-r--r-- | .classpath | 8 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | .project | 33 | ||||
-rw-r--r-- | AndroidManifest.xml | 25 | ||||
-rw-r--r-- | README | 29 | ||||
-rw-r--r-- | assets/Placitas_Green_pillow.jpg | bin | 0 -> 8225 bytes | |||
-rw-r--r-- | assets/Placitas_Green_pillow_512.jpg | bin | 0 -> 31789 bytes | |||
-rw-r--r-- | proguard.cfg | 40 | ||||
-rw-r--r-- | project.properties | 12 | ||||
-rw-r--r-- | res/drawable-xxhdpi/ic_launch_placitas_green_pillow.jpg | bin | 0 -> 6226 bytes | |||
-rw-r--r-- | res/layout/main.xml | 39 | ||||
-rw-r--r-- | res/values/strings.xml | 17 | ||||
-rw-r--r-- | src/net/onefang/toyboxInstaller/MainActivity.java | 37 |
13 files changed, 236 insertions, 6 deletions
diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..a4763d1 --- /dev/null +++ b/.classpath | |||
@@ -0,0 +1,8 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <classpath> | ||
3 | <classpathentry kind="src" path="src"/> | ||
4 | <classpathentry kind="src" path="gen"/> | ||
5 | <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> | ||
6 | <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> | ||
7 | <classpathentry kind="output" path="bin/classes"/> | ||
8 | </classpath> | ||
@@ -0,0 +1,2 @@ | |||
1 | gen/ | ||
2 | # project.properties is generated, but includes a comment that it should be included in source control. shrugs | ||
diff --git a/.project b/.project new file mode 100644 index 0000000..d1e8424 --- /dev/null +++ b/.project | |||
@@ -0,0 +1,33 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <projectDescription> | ||
3 | <name>AppTemplate</name> | ||
4 | <comment></comment> | ||
5 | <projects> | ||
6 | </projects> | ||
7 | <buildSpec> | ||
8 | <buildCommand> | ||
9 | <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> | ||
10 | <arguments> | ||
11 | </arguments> | ||
12 | </buildCommand> | ||
13 | <buildCommand> | ||
14 | <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> | ||
15 | <arguments> | ||
16 | </arguments> | ||
17 | </buildCommand> | ||
18 | <buildCommand> | ||
19 | <name>org.eclipse.jdt.core.javabuilder</name> | ||
20 | <arguments> | ||
21 | </arguments> | ||
22 | </buildCommand> | ||
23 | <buildCommand> | ||
24 | <name>com.android.ide.eclipse.adt.ApkBuilder</name> | ||
25 | <arguments> | ||
26 | </arguments> | ||
27 | </buildCommand> | ||
28 | </buildSpec> | ||
29 | <natures> | ||
30 | <nature>com.android.ide.eclipse.adt.AndroidNature</nature> | ||
31 | <nature>org.eclipse.jdt.core.javanature</nature> | ||
32 | </natures> | ||
33 | </projectDescription> | ||
diff --git a/AndroidManifest.xml b/AndroidManifest.xml new file mode 100644 index 0000000..d48beef --- /dev/null +++ b/AndroidManifest.xml | |||
@@ -0,0 +1,25 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | package="net.onefang.toyboxInstaller" | ||
4 | android:versionCode="1" | ||
5 | android:versionName="0.4.8" > | ||
6 | |||
7 | <uses-sdk | ||
8 | android:minSdkVersion="4" | ||
9 | android:targetSdkVersion="16" /> | ||
10 | |||
11 | <application | ||
12 | android:icon="@drawable/ic_launch_placitas_green_pillow" | ||
13 | android:label="@string/app_name" > | ||
14 | <activity | ||
15 | android:label="@string/app_name" | ||
16 | android:name=".MainActivity" > | ||
17 | <intent-filter > | ||
18 | <action android:name="android.intent.action.MAIN" /> | ||
19 | |||
20 | <category android:name="android.intent.category.LAUNCHER" /> | ||
21 | </intent-filter> | ||
22 | </activity> | ||
23 | </application> | ||
24 | |||
25 | </manifest> | ||
@@ -1,7 +1,14 @@ | |||
1 | This is an Android installer for Rob Landley's toybox. | 1 | This is an Android installer for Rob Landley's toybox. Toybox combines |
2 | common Linux command line utilities together into a single BSD-licensed | ||
3 | executable that's simple, small, fast, reasonably standards-compliant, | ||
4 | and powerful enough to turn Android into a development environment. | ||
2 | 5 | ||
3 | http://landley.net/code/toybox/ | 6 | http://landley.net/code/toybox/ |
4 | 7 | ||
8 | In general I'll follow toybox's version number, even if there is no need | ||
9 | to change this code. Currently that's 0.4.8. If I ever have to change | ||
10 | the code between toybox versions, I'll add another point. | ||
11 | |||
5 | 12 | ||
6 | Design. | 13 | Design. |
7 | ======= | 14 | ======= |
@@ -10,14 +17,19 @@ My initial design thoughts are to download a recent binary of toybox | |||
10 | from Rob's web site that is suitable for what ever CPU we are running | 17 | from Rob's web site that is suitable for what ever CPU we are running |
11 | on. | 18 | on. |
12 | 19 | ||
13 | http://landley.net/code/toybox/bin/ | 20 | http://landley.net/code/toybox/downloads/binaries/ |
21 | |||
22 | java.lang.System.getProperty("os.arch"); returns things like "armv7l". | ||
23 | Currently the latests toybox binaries download only provides ARM 4, 5, | ||
24 | and 6 versions. So would need some massaging to get the closest match. | ||
14 | 25 | ||
15 | Then provide a list of the folders in the current PATH, so the user can | 26 | Then provide a list of the folders in the current PATH, so the user can |
16 | select where to install it. Likely root will be needed, though I think | 27 | select where to install it. Likely root will be needed, though I think |
17 | there are non root ways of running things like toybox. I dunno yet if | 28 | there are non root ways of running things like toybox. |
18 | access to the PATH is possible, or the CPU type. We shall see. | ||
19 | 29 | ||
20 | A fall back option is to use some sort of directory picker. | 30 | A fall back option is to use some sort of directory picker. Might just |
31 | provide that anyway, for extra flexibility. One more option might be to | ||
32 | allow a choice of versions to install. | ||
21 | 33 | ||
22 | 34 | ||
23 | About the logo. | 35 | About the logo. |
@@ -33,6 +45,12 @@ image for the toybox logo. So the Placitas_Green_pillow.jpg image, and | |||
33 | all derivations of it, are used with permission from Bruce Gardner. | 45 | all derivations of it, are used with permission from Bruce Gardner. |
34 | Thank you Bruce. | 46 | Thank you Bruce. |
35 | 47 | ||
48 | Original image size is 176x176, Android requires MDPI 48x48, HDPI 72x72, | ||
49 | XHDPI 96x96, XXHDPI 144x144, XXXHDPI 192x192, and Google Play logo at | ||
50 | 512x512. LDPI is also supported, but that gets the HDPI scaled down to | ||
51 | 36x36 automatically. Actually Android in general takes what it has and | ||
52 | tries to scale it as best it can. Cropping it to 144 works OK. | ||
53 | |||
36 | 54 | ||
37 | Authors. | 55 | Authors. |
38 | ======== | 56 | ======== |
@@ -48,4 +66,3 @@ License. | |||
48 | 66 | ||
49 | ToyboxInstaller is licensed under the same BSD style license that toybox | 67 | ToyboxInstaller is licensed under the same BSD style license that toybox |
50 | is licensed under. See the toybox web site above for details. | 68 | is licensed under. See the toybox web site above for details. |
51 | |||
diff --git a/assets/Placitas_Green_pillow.jpg b/assets/Placitas_Green_pillow.jpg new file mode 100644 index 0000000..3e38abb --- /dev/null +++ b/assets/Placitas_Green_pillow.jpg | |||
Binary files differ | |||
diff --git a/assets/Placitas_Green_pillow_512.jpg b/assets/Placitas_Green_pillow_512.jpg new file mode 100644 index 0000000..ae097b8 --- /dev/null +++ b/assets/Placitas_Green_pillow_512.jpg | |||
Binary files differ | |||
diff --git a/proguard.cfg b/proguard.cfg new file mode 100644 index 0000000..b1cdf17 --- /dev/null +++ b/proguard.cfg | |||
@@ -0,0 +1,40 @@ | |||
1 | -optimizationpasses 5 | ||
2 | -dontusemixedcaseclassnames | ||
3 | -dontskipnonpubliclibraryclasses | ||
4 | -dontpreverify | ||
5 | -verbose | ||
6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* | ||
7 | |||
8 | -keep public class * extends android.app.Activity | ||
9 | -keep public class * extends android.app.Application | ||
10 | -keep public class * extends android.app.Service | ||
11 | -keep public class * extends android.content.BroadcastReceiver | ||
12 | -keep public class * extends android.content.ContentProvider | ||
13 | -keep public class * extends android.app.backup.BackupAgentHelper | ||
14 | -keep public class * extends android.preference.Preference | ||
15 | -keep public class com.android.vending.licensing.ILicensingService | ||
16 | |||
17 | -keepclasseswithmembernames class * { | ||
18 | native <methods>; | ||
19 | } | ||
20 | |||
21 | -keepclasseswithmembers class * { | ||
22 | public <init>(android.content.Context, android.util.AttributeSet); | ||
23 | } | ||
24 | |||
25 | -keepclasseswithmembers class * { | ||
26 | public <init>(android.content.Context, android.util.AttributeSet, int); | ||
27 | } | ||
28 | |||
29 | -keepclassmembers class * extends android.app.Activity { | ||
30 | public void *(android.view.View); | ||
31 | } | ||
32 | |||
33 | -keepclassmembers enum * { | ||
34 | public static **[] values(); | ||
35 | public static ** valueOf(java.lang.String); | ||
36 | } | ||
37 | |||
38 | -keep class * implements android.os.Parcelable { | ||
39 | public static final android.os.Parcelable$Creator *; | ||
40 | } | ||
diff --git a/project.properties b/project.properties new file mode 100644 index 0000000..b160b17 --- /dev/null +++ b/project.properties | |||
@@ -0,0 +1,12 @@ | |||
1 | # This file is automatically generated by Android Tools. | ||
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! | ||
3 | # | ||
4 | # This file must be checked in Version Control Systems. | ||
5 | # | ||
6 | # To customize properties used by the Ant build system use, | ||
7 | # "ant.properties", and override values to adapt the script to your | ||
8 | # project structure. | ||
9 | |||
10 | # Project target. | ||
11 | target=android-16 | ||
12 | |||
diff --git a/res/drawable-xxhdpi/ic_launch_placitas_green_pillow.jpg b/res/drawable-xxhdpi/ic_launch_placitas_green_pillow.jpg new file mode 100644 index 0000000..eedf7dc --- /dev/null +++ b/res/drawable-xxhdpi/ic_launch_placitas_green_pillow.jpg | |||
Binary files differ | |||
diff --git a/res/layout/main.xml b/res/layout/main.xml new file mode 100644 index 0000000..7136eb1 --- /dev/null +++ b/res/layout/main.xml | |||
@@ -0,0 +1,39 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | android:layout_width="fill_parent" | ||
4 | android:layout_height="fill_parent" | ||
5 | android:gravity="center" | ||
6 | android:orientation="vertical" > | ||
7 | |||
8 | <TextView android:id="@+id/hello" | ||
9 | android:layout_width="wrap_content" | ||
10 | android:layout_height="wrap_content" | ||
11 | android:text="@string/hello" /> | ||
12 | |||
13 | <TextView android:id="@+id/version" | ||
14 | android:layout_width="wrap_content" | ||
15 | android:layout_height="wrap_content" | ||
16 | android:text="@string/version" /> | ||
17 | |||
18 | <TextView android:id="@+id/cpu" | ||
19 | android:layout_width="wrap_content" | ||
20 | android:layout_height="wrap_content" | ||
21 | android:text="@string/cpu" /> | ||
22 | |||
23 | <TextView android:id="@+id/path" | ||
24 | android:layout_width="wrap_content" | ||
25 | android:layout_height="wrap_content" | ||
26 | android:text="@string/path" /> | ||
27 | |||
28 | <TextView android:id="@+id/folder" | ||
29 | android:layout_width="wrap_content" | ||
30 | android:layout_height="wrap_content" | ||
31 | android:text="@string/folder" /> | ||
32 | |||
33 | <Button android:id="@+id/install" | ||
34 | android:layout_width="wrap_content" | ||
35 | android:layout_height="wrap_content" | ||
36 | android:text="@string/button_install" | ||
37 | android:onClick="installToybox" /> | ||
38 | |||
39 | </LinearLayout> | ||
diff --git a/res/values/strings.xml b/res/values/strings.xml new file mode 100644 index 0000000..bd2d3af --- /dev/null +++ b/res/values/strings.xml | |||
@@ -0,0 +1,17 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <resources> | ||
3 | |||
4 | <string name="app_name">toyboxInstaller</string> | ||
5 | <string name="hello"> | ||
6 | This app is used for installing Rob Landley\'s toybox. | ||
7 | Toybox combines common Linux command line utilities together | ||
8 | into a single BSD-licensed executable that\'s simple, small, fast, | ||
9 | reasonably standards-compliant, and powerful enough to turn | ||
10 | Android into a development environment.\n\n</string> | ||
11 | <string name="version">The currently installed toybox version is</string> | ||
12 | <string name="cpu">The CPU type here is</string> | ||
13 | <string name="path">Select where you want to install toybox\n\nfrom the PATH -\n</string> | ||
14 | <string name="folder">or into a folder -\n</string> | ||
15 | <string name="button_install">Install toybox.</string> | ||
16 | |||
17 | </resources> | ||
diff --git a/src/net/onefang/toyboxInstaller/MainActivity.java b/src/net/onefang/toyboxInstaller/MainActivity.java new file mode 100644 index 0000000..e6c690f --- /dev/null +++ b/src/net/onefang/toyboxInstaller/MainActivity.java | |||
@@ -0,0 +1,37 @@ | |||
1 | package net.onefang.toyboxInstaller; | ||
2 | |||
3 | import android.app.*; | ||
4 | import android.os.*; | ||
5 | import android.view.*; | ||
6 | import android.widget.*; | ||
7 | import java.lang.System.*; | ||
8 | |||
9 | public class MainActivity extends Activity | ||
10 | { | ||
11 | /** Called when the activity is first created. */ | ||
12 | @Override | ||
13 | public void onCreate(Bundle savedInstanceState) | ||
14 | { | ||
15 | super.onCreate(savedInstanceState); | ||
16 | setContentView(R.layout.main); | ||
17 | |||
18 | TextView version = (TextView) findViewById(R.id.version); | ||
19 | String VERSION = getString(R.string.version); | ||
20 | TextView cpu = (TextView) findViewById(R.id.cpu); | ||
21 | String CPU = getString(R.string.cpu); | ||
22 | TextView path = (TextView) findViewById(R.id.path); | ||
23 | String PATH = getString(R.string.path); | ||
24 | String pathSep = java.lang.System.getProperty("path.separator"); | ||
25 | TextView folder = (TextView) findViewById(R.id.folder); | ||
26 | String FOLDER = getString(R.string.folder); | ||
27 | |||
28 | version.setText(VERSION + " " + "unknown" + ".\n"); | ||
29 | cpu.setText(CPU + " " + java.lang.System.getProperty("os.arch") + ".\n"); | ||
30 | path.setText(PATH + " " + java.lang.System.getenv("PATH") + "\n"); | ||
31 | folder.setText(FOLDER + " " + "" + "\n"); | ||
32 | } | ||
33 | |||
34 | public void installToybox(View view) | ||
35 | { | ||
36 | } | ||
37 | } | ||