mirror of
https://github.com/edubart/otclient.git
synced 2025-11-02 19:56:24 +01:00
Compiling for android but have some bugs
This commit is contained in:
@@ -1,10 +1,35 @@
|
||||
#include <jni.h>
|
||||
#include <main.cpp>
|
||||
/*
|
||||
* Copyright (c) 2010-2014 OTClient <https://github.com/edubart/otclient>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <android_native_app_glue.h>
|
||||
#include <client/client.h>
|
||||
|
||||
void android_main( struct android_app* state ) {
|
||||
int argc = 0;
|
||||
int argc = 1;
|
||||
const char* argv[1];
|
||||
argv[0] = NULL;
|
||||
argv[0] = "NULL";
|
||||
|
||||
main(argc, argv);
|
||||
Client client( argc, argv );
|
||||
client.terminateAndFreeMemory();
|
||||
|
||||
ANativeActivity_finish(state->activity);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
#!/bin/sh
|
||||
mkdir ../build && cd ../build
|
||||
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=../android/android.toolchain.cmake -DANDROID_ABI=armeabi -DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.6 ..
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=../android/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=android-16 -DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.6 ..
|
||||
make
|
||||
|
||||
cd ../ && rm -r build && mkdir build && cd build
|
||||
cd ../ && rm -r build
|
||||
|
||||
cp -r libs android/project/ && rm -r libs
|
||||
|
||||
cd android/project
|
||||
|
||||
android update project -p . --name OTClientMob --target android-16
|
||||
|
||||
ant debug
|
||||
|
||||
cd bin
|
||||
|
||||
adb install -r OTClientMob-debug.apk
|
||||
|
||||
Reference in New Issue
Block a user