Skip to content

Commit 2c24341

Browse files
committed
bootstrap: start native code for the minimal bootstrap. The log message is printed!
1 parent a8f16bf commit 2c24341

File tree

5 files changed

+50
-2
lines changed

5 files changed

+50
-2
lines changed

bootstrap/common/templates/AndroidManifest.tmpl.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
<application android:label="@string/appName"
2020
android:icon="@drawable/icon"
2121
android:hardwareAccelerated="true"
22+
android:hasCode="{{ args.bootstrap.hascode|default("true") }}"
2223
>
23-
2424
{% for m in args.meta_data %}
2525
<meta-data android:name="{{ m.split('=', 1)[0] }}" android:value="{{ m.split('=', 1)[-1] }}"/>{% endfor %}
2626
<meta-data android:name="fullscreen" android:value="{% if args.window %}0{% else %}1{% endif %}"/>
@@ -36,6 +36,12 @@
3636
android:windowSoftInputMode="stateAlwaysHidden"
3737
>
3838

39+
{% if args.bootstrap.lib_name %}
40+
<meta-data android:name="android.app.lib_name"
41+
android:value="{{ args.bootstrap.lib_name }}" />
42+
{% endif %}
43+
44+
3945
{% if args.launcher %}
4046
<intent-filter>
4147
<action android:name="org.renpy.LAUNCH" />
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
bootstrap.entrypoint=org.renpy.android.PythonActivity
1+
bootstrap.entrypoint=android.app.NativeActivity
2+
bootstrap.hascode=false
3+
bootstrap.lib_name=native-activity

bootstrap/minimal/jni/Android.mk

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (C) 2010 The Android Open Source Project
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
LOCAL_PATH := $(call my-dir)
16+
17+
include $(CLEAR_VARS)
18+
19+
LOCAL_MODULE := native-activity
20+
LOCAL_SRC_FILES := main.c
21+
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM
22+
LOCAL_STATIC_LIBRARIES := android_native_app_glue
23+
24+
include $(BUILD_SHARED_LIBRARY)
25+
26+
$(call import-module,android/native_app_glue)

bootstrap/minimal/jni/Application.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
APP_PLATFORM := android-9

bootstrap/minimal/jni/main.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <jni.h>
2+
#include <errno.h>
3+
#include <android/log.h>
4+
#include <android_native_app_glue.h>
5+
6+
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "native-activity", __VA_ARGS__))
7+
#define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "native-activity", __VA_ARGS__))
8+
9+
10+
void android_main(struct android_app* state) {
11+
app_dummy();
12+
LOGI("android_main: starting minimal bootstrap.");
13+
}

0 commit comments

Comments
 (0)