Compare commits
4 commits
0fafc86d02
...
4c5d201e58
Author | SHA1 | Date | |
---|---|---|---|
4c5d201e58 | |||
b430e205dc | |||
488f0da7e8 | |||
5b20785703 |
5 changed files with 46 additions and 40 deletions
19
Makefile
19
Makefile
|
@ -8,17 +8,30 @@ build:
|
||||||
install:
|
install:
|
||||||
adb install -r ./apk/example.app.apk
|
adb install -r ./apk/example.app.apk
|
||||||
|
|
||||||
clean:
|
.PHONY: clean-all
|
||||||
|
clean-all: clean-docker clean-apk
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: clean-docker
|
||||||
|
clean-docker:
|
||||||
rm docker-compose-build.log || true
|
rm docker-compose-build.log || true
|
||||||
docker-compose down --remove-orphans --rmi all
|
docker-compose down --remove-orphans --rmi all
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: clean-apk
|
||||||
|
clean-apk:
|
||||||
|
cd apk && $(MAKE) clean
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
apk: apk/app.apk
|
apk: apk/app.apk
|
||||||
true
|
true
|
||||||
|
|
||||||
apk/app.apk: docker-compose-build.log
|
apk/app.apk: docker-compose-build.log
|
||||||
docker-compose run compile
|
docker-compose run --rm compile
|
||||||
|
|
||||||
docker-compose-build.log: Dockerfile docker-compose.yml
|
docker-compose-build.log: Dockerfile docker-compose.yml
|
||||||
docker-compose down --remove-orphans --rmi all
|
docker-compose down --remove-orphans --rmi all
|
||||||
BUILDKIT_PROGRESS=plain docker-compose build --no-cache | tee docker-compose-build.log
|
BUILDKIT_PROGRESS=plain docker-compose build | tee docker-compose-build.log
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
# Repo allowing -in a KISS way- to create a containered way to build an Android App APK
|
# Repo allowing -in a KISS way- to create a containered way to build an Android App APK
|
||||||
|
|
||||||
|
## brach `no-res.xml`
|
||||||
|
|
||||||
|
this branch features the exmaple.app to not require the compoletely bogus unneeded requirement
|
||||||
|
to setup a `./apk/res/layouts/res.xml` file to setup the layout to be used.
|
||||||
|
Instead a layout is created inline
|
||||||
|
|
||||||
|
|
||||||
## tl;dr
|
## tl;dr
|
||||||
|
|
||||||
to `make` minimal exmaple.app via the docker-compose:
|
to `make` minimal exmaple.app via the docker-compose:
|
||||||
|
@ -20,7 +27,7 @@ This will generate the APK file `./apk/example.app.apk`
|
||||||
|
|
||||||
this can be installed via `adb`
|
this can be installed via `adb`
|
||||||
```
|
```
|
||||||
adb install -r ./apk/exmple.app.apk
|
adb install -r ./apk/example.app.apk
|
||||||
# or alternative type
|
# or alternative type
|
||||||
make install
|
make install
|
||||||
```
|
```
|
||||||
|
|
|
@ -25,6 +25,7 @@ build : ./bin/example.app.apk
|
||||||
jarsigner -verbose -keystore ./ToyKey.keystore -storepass armena -keypass armena -signedjar $@ $< helljniKey
|
jarsigner -verbose -keystore ./ToyKey.keystore -storepass armena -keypass armena -signedjar $@ $< helljniKey
|
||||||
|
|
||||||
./bin/unsigned.apk : ./bin/classes.dex
|
./bin/unsigned.apk : ./bin/classes.dex
|
||||||
|
rm -rvf "$@"
|
||||||
$(ANDROID_HOME)/build-tools/$(ANDROID_VERSION)/aapt package -v -u -f -M ./AndroidManifest.xml -S ./res \
|
$(ANDROID_HOME)/build-tools/$(ANDROID_VERSION)/aapt package -v -u -f -M ./AndroidManifest.xml -S ./res \
|
||||||
-I $(ANDROID_HOME)/platforms/$(PLATFORM)/android.jar -F $@ ./bin
|
-I $(ANDROID_HOME)/platforms/$(PLATFORM)/android.jar -F $@ ./bin
|
||||||
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="aa"
|
|
||||||
/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
|
@ -4,32 +4,30 @@ import android.util.Log;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import android.text.method.ScrollingMovementMethod;
|
import android.text.method.ScrollingMovementMethod;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.*;
|
||||||
|
import android.widget.*;
|
||||||
|
import android.view.ViewGroup.*;
|
||||||
|
|
||||||
public class ExampleApp extends Activity
|
public class ExampleApp extends Activity {
|
||||||
{
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState)
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
//volatile String result = "initial";
|
// creating LinearLayout
|
||||||
String result = "initial";
|
LinearLayout linLayout = new LinearLayout(this);
|
||||||
|
// specifying vertical orientation
|
||||||
|
linLayout.setOrientation(LinearLayout.VERTICAL);
|
||||||
|
// creating LayoutParams
|
||||||
|
LayoutParams linLayoutParam = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
|
||||||
|
// set LinearLayout as a root element of the screen
|
||||||
|
setContentView(linLayout, linLayoutParam);
|
||||||
|
|
||||||
|
LayoutParams lpView = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
|
||||||
|
|
||||||
TextView tv = new TextView(this);
|
TextView tv = new TextView(this);
|
||||||
tv.setMovementMethod(new ScrollingMovementMethod());
|
tv.setText("SUPERVIEalexW");
|
||||||
tv.setText( result);
|
tv.setLayoutParams(lpView);
|
||||||
setContentView(tv);
|
linLayout.addView(tv);
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue