Skip to content

Commit

Permalink
Add Android project.
Browse files Browse the repository at this point in the history
  • Loading branch information
mansourmoufid committed Sep 2, 2019
1 parent 8aa86cc commit dc0a259
Show file tree
Hide file tree
Showing 9 changed files with 521 additions and 0 deletions.
41 changes: 41 additions & 0 deletions chirpy-android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.eliteraspberries.chirpy"
versionCode 1
versionName "0.1"
minSdkVersion rootProject.ext.minSdkVersion
ndk {
abiFilters rootProject.ext.abiFilters
}
resConfigs rootProject.ext.resConfigs
}
buildTypes {
debug {
debuggable true
minifyEnabled false
shrinkResources false
useProguard false
}
release {
debuggable false
minifyEnabled false
shrinkResources false
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}

dependencies {
compile 'com.android.support:multidex:1.0.3'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
compile project(':love')
}
44 changes: 44 additions & 0 deletions chirpy-android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
package="com.eliteraspberries.chirpy"
android:installLocation="auto"
xmlns:android="http://schemas.android.com/apk/res/android">

<!--
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
-->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-feature android:glEsVersion="0x00020000" />

<compatible-screens>
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
<screen android:screenSize="normal" android:screenDensity="xxhdpi" />
<screen android:screenSize="large" android:screenDensity="mdpi" />
<screen android:screenSize="large" android:screenDensity="hdpi" />
<screen android:screenSize="large" android:screenDensity="xhdpi" />
<screen android:screenSize="large" android:screenDensity="xxhdpi" />
</compatible-screens>

<application
android:allowBackup="true"
android:icon="@drawable/love"
android:label="Chirpy"
android:theme="@style/ChirpyTheme" >
<activity
android:name="org.love2d.android.GameActivity"
android:configChanges="orientation|screenSize|keyboard|keyboardHidden|navigation"
android:label="Chirpy"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
10 changes: 10 additions & 0 deletions chirpy-android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<resources>

<style name="LÖVETheme" parent="@android:style/Theme.NoTitleBar.Fullscreen">
<item name="android:windowFullscreen">true</item>
</style>

<style name="ChirpyTheme" parent="@style/LÖVETheme">
</style>

</resources>
29 changes: 29 additions & 0 deletions chirpy-android/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

allprojects {
repositories {
google()
}
}

ext {
compileSdkVersion = 28
buildToolsVersion = '28.0.2'
supportLibVersion = '28.0.0'
abiFilters = 'armeabi-v7a'
minSdkVersion = 19
targetSdkVersion = 19
resConfigs = 'en'
}
6 changes: 6 additions & 0 deletions chirpy-android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Mon Sep 02 10:36:17 EDT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
33 changes: 33 additions & 0 deletions chirpy-android/love/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
ndk {
abiFilters rootProject.ext.abiFilters
}
resConfigs rootProject.ext.resConfigs
}
sourceSets {
main {
java {
srcDirs('src/main/java', 'src/jni/SDL2-2.0.7/android-project/app/src/main/java')
}
}
}
externalNativeBuild {
ndkBuild {
path "src/jni/Android.mk"
}
}
lintOptions {
abortOnError false
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
}
19 changes: 19 additions & 0 deletions chirpy-android/love/src/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Uncomment this if you're using STL in your project
# See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information
# APP_STL := stlport_static
APP_STL := c++_shared
APP_ABI := armeabi-v7a
APP_CPPFLAGS += -DNDEBUG
APP_CFLAGS += -fpic -frtti -fwrapv
APP_CFLAGS += -Os
#APP_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv4
#APP_CFLAGS += -mthumb
APP_LDFLAGS := -llog -landroid -lz
APP_PLATFORM := 19
NDK_TOOLCHAIN_VERSION := clang

# Fix for building on Windows
# http://stackoverflow.com/questions/12598933/ndk-build-createprocess-make-e-87-the-parameter-is-incorrect
APP_SHORT_COMMANDS := true

# APP_OPTIM := debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
Loading

0 comments on commit dc0a259

Please sign in to comment.