Compare commits

..

No commits in common. "4c5d201e58855b946d112ea8e9b4adc9b21412c3" and "0fafc86d0277338d45ae4b0caf39341a31cfa0ce" have entirely different histories.

5 changed files with 40 additions and 46 deletions

View file

@ -8,30 +8,17 @@ build:
install: install:
adb install -r ./apk/example.app.apk adb install -r ./apk/example.app.apk
.PHONY: clean-all clean:
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 --rm compile docker-compose run 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 | tee docker-compose-build.log BUILDKIT_PROGRESS=plain docker-compose build --no-cache | tee docker-compose-build.log

View file

@ -1,12 +1,5 @@
# 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:
@ -27,7 +20,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/example.app.apk adb install -r ./apk/exmple.app.apk
# or alternative type # or alternative type
make install make install
``` ```

View file

@ -25,7 +25,6 @@ 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

13
apk/res/layout/main.xml Normal file
View file

@ -0,0 +1,13 @@
<?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>

View file

@ -4,30 +4,32 @@ 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)
super.onCreate(savedInstanceState); {
// creating LinearLayout try
LinearLayout linLayout = new LinearLayout(this); {
// specifying vertical orientation super.onCreate(savedInstanceState);
linLayout.setOrientation(LinearLayout.VERTICAL); //volatile String result = "initial";
// creating LayoutParams String result = "initial";
LayoutParams linLayoutParam = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); TextView tv = new TextView(this);
// set LinearLayout as a root element of the screen tv.setMovementMethod(new ScrollingMovementMethod());
setContentView(linLayout, linLayoutParam); tv.setText( result);
setContentView(tv);
} catch (Exception e) {
throw new RuntimeException(e);
}
LayoutParams lpView = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
TextView tv = new TextView(this);
tv.setText("SUPERVIEalexW");
tv.setLayoutParams(lpView);
linLayout.addView(tv);
} }
} }