More bug fix
master
MoNTE48 2014-10-26 13:13:47 +02:00
parent 5aea8e71aa
commit efd276a3ae
19 changed files with 178 additions and 177 deletions

View File

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.Minetest.Mobile.FREE"
android:installLocation="auto"
android:versionCode="10"
android:versionCode="15"
android:versionName="@string/ver" >
<uses-sdk
@ -10,21 +10,24 @@
android:targetSdkVersion="20" />
<supports-screens
android:requiresSmallestWidthDp="480"
android:requiresSmallestWidthDp="600"
android:smallScreens="false" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<activity
android:name="com.Minetest.Mobile.MainActivity"
android:screenOrientation="landscape" >
android:screenOrientation="sensorLandscape"
android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -34,9 +37,10 @@
<activity
android:name="org.minetest.minetest.MtNativeActivity"
android:clearTaskOnLaunch="true"
android:configChanges="orientation|keyboardHidden"
android:configChanges="orientation|keyboardHidden|screenSize"
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:screenOrientation="landscape" >
android:screenOrientation="sensorLandscape" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
@ -52,15 +56,15 @@
</activity>
<activity
android:name="com.Minetest.Mobile.Start"
android:screenOrientation="landscape"
android:screenOrientation="sensorLandscape"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" >
</activity>
<activity
android:name="com.Minetest.Mobile.About"
android:theme="@android:style/Theme.Holo.Light.Dialog" >
</activity>
<activity android:name="com.Minetest.Mobile.DownloadActivity" >
</activity>
</application>
</manifest>

View File

@ -1,6 +1,7 @@
Go to:
https://github.com/minetest/minetest
(I use official libs, no change!).
Get this repo on your pc.
cd build/android
Make or CMake
(I use official libs, no change!)
=== === ===
apt-get install git
git clone https://github.com/minetest/minetest.git
cd minetest/build/android
apt-get install wget subversion ant
make

View File

@ -1,3 +1,3 @@
target=android-19
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
android.library.reference.1=../library
android.library.reference.1=../RateMe

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#FFFFFF" />
<solid android:color="#00FF00" />
<corners
android:bottomLeftRadius="15dp"

View File

@ -2,16 +2,6 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/ver"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/aboutt"
android:gravity="center"
android:text="@string/ver" />
<TextView
android:id="@+id/aboutt"
android:layout_width="wrap_content"
@ -21,6 +11,17 @@
android:layout_alignParentTop="true"
android:gravity="center"
android:text="@string/app_name"
android:textSize="25dp" />
<TextView
android:id="@+id/ver"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/aboutt"
android:gravity="center"
android:text="@string/ver"
android:textSize="20dp" />
<Button
@ -33,7 +34,8 @@
android:layout_marginTop="15dp"
android:background="@drawable/button"
android:onClick="wiki"
android:text="@string/site" />
android:text="@string/site"
android:textSize="25dp" />
<Button
android:id="@+id/RateMeSourse"
@ -45,7 +47,7 @@
android:layout_marginTop="10dp"
android:background="@drawable/button"
android:onClick="RateMeSourse"
android:text="Rate Me Sourse" />
android:text="Rate Me Plugin " />
<TextView
android:id="@+id/textView1"
@ -56,7 +58,8 @@
android:layout_below="@+id/RateMeSourse"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="URL on build sourse you can found on Google Play!" />
android:text="ALL sourse Minetest for Android Project:
http://goo.gl/o99V2a" />
<TextView
android:id="@+id/dev"
@ -78,7 +81,7 @@
android:layout_marginTop="50dp"
android:gravity="center"
android:text="Open Sourse!"
android:textAppearance="?android:attr/textAppearanceLarge" />
android:textSize="25dp" />
<Button
android:id="@+id/MinetestReadme"

View File

@ -1,12 +1,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:paddingBottom="0.0dip"
android:paddingLeft="0.0dip"
android:paddingRight="0.0dip"
android:paddingTop="0.0dip" >
android:layout_height="match_parent" >
<ImageView
android:id="@+id/icon"
@ -22,34 +17,12 @@
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:alpha="0.9"
android:background="#00FF00"
android:alpha="0.7"
android:background="@drawable/button"
android:onClick="start"
android:text="@string/open"
android:textSize="30sp" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:alpha="0.8"
android:onClick="About"
android:background="#ceff99"
android:text="@string/About"/>
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/button1"
android:alpha="0.8"
android:background="#ceff99"
android:text="Official site: Minetest.net" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
@ -64,14 +37,35 @@
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/button1"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:alpha="0.8"
android:layout_marginBottom="10dp"
android:alpha="0.9"
android:background="#ceff99"
android:gravity="center"
android:text="@string/hello"
android:textColor="#000000"
android:textSize="20sp" />
android:textSize="25dp" />
<Button
android:id="@+id/button1"
android:layout_width="200dp"
android:layout_height="50dp"
android:layout_above="@+id/textView1"
android:layout_alignParentLeft="true"
android:alpha="0.8"
android:background="@drawable/button"
android:onClick="About"
android:text="@string/About"
android:textSize="18sp" />
<com.startapp.android.publish.banner.Banner
android:id="@+id/startAppBanner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/nextbtn" >
</com.startapp.android.publish.banner.Banner>
</RelativeLayout>

View File

@ -2,11 +2,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:paddingBottom="0.0dip"
android:paddingLeft="0.0dip"
android:paddingRight="0.0dip"
android:paddingTop="0.0dip" >
android:keepScreenOn="true">
<ImageView
android:id="@+id/icon"
@ -22,8 +18,8 @@
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:alpha="0.9"
android:background="#00FF00"
android:alpha="0.7"
android:background="@drawable/button"
android:text="@string/start"
android:textSize="30sp" />

View File

@ -5,12 +5,12 @@
<string name="About">О проекте "Minetest for Android"</string>
<string name="unpack">Установка обновлений&#8230;</string>
<string name="hello">Minetest for Android — проект с открытым исходным кодом на основе Minetest.</string>
<string name="open">Нажмите для продолжения</string>
<string name="warning">Во время распаковки не сворачивайте приложение. Иначе распаковка пройдёт с ошибками.</string>
<string name="open"><u>Нажмите для продолжения</u></string>
<string name="warning">Во время обновления не закрывайте приложение. Иначе обновление может пройти с ошибкой.</string>
<string name="check">Проверка обновлений&#8230;</string>
<string name="stgame">Для начала игры нажмите "Start Singleplayer"!</string>
<string name="stgame">Для начала игры нажмите "New" и создайте мир!</string>
<string name="disconnect">Отсутствует подключение к Интернету! Повторите попытку.</string>
<string name="download">Загрузка необходимых файлн&#8230;</string>
<string name="download">Загрузка необходимых файлов&#8230;</string>
<string name="wiki">http://minetest.ru/wiki/</string>
<string name="rmold">Удаление устаревших файлов&#8230;</string>
<string name="bad">Ваш игровой мир будет пересоздан&#8230;</string>

View File

@ -10,14 +10,13 @@
<string name="warning">When unpacking, do not wrap application. Otherwise, unpacking may take with errors.</string>
<string name="check">Checking the version&#8230;</string>
<string name="extract">Extract files&#8230;</string>
<string name="stgame">To start the game, click "Start Singleplayer"!</string>
<string name="stgame">To start the game, click "New" and create the world!</string>
<string name="disconnect">No network available! Try again.</string>
<string name="download">Downloading Zip File..</string>
<string name="site"><i>Open Minetest Wiki</i></string>
<string name="dev">Dev by MoNTE48 (MoNTE48@mail.ua), 2014</string>
<string name="wiki">http://wiki.minetest.com/wiki/</string>
<string name="rmold">Remove old files&#8230;</string>
<string name="ver">0.4.10 | build 1.4.3</string>
<string name="ver">0.4.11-dev | build 1.7</string>
<string name="bad">Your game world is recreated!</string>
</resources>

View File

@ -62,14 +62,9 @@ public class About extends Activity {
// îòêðûâàþ ñàéò ÷-ç Uri
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri
.parse((String) getResources().getText(R.string.wiki)));
startActivity(intent);
}
}

View File

@ -1,39 +1,32 @@
package com.Minetest.Mobile;
import java.util.Timer;
import java.util.TimerTask;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import com.Minetest.Mobile.FREE.R;
import com.kskkbys.rate.RateThisApp;
public class MainActivity extends Activity {
Button button3;
private StartAppAd startAppAd = new StartAppAd(this);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// init rate plugin
RateThisApp.onStart(this);
RateThisApp.showRateDialogIfNeeded(this);
button3 = (Button) findViewById(R.id.button3);
button3.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://minetest.net/"));
startActivity(intent);
}
});
}
public void About(View view) {
Intent intent = new Intent(this, About.class);
startActivity(intent);
}
@ -41,4 +34,4 @@ public class MainActivity extends Activity {
Intent intent = new Intent(this, Start.class);
startActivity(intent);
}
}
}

View File

@ -43,10 +43,9 @@ public class Start extends Activity {
String unzipLocation = Environment.getExternalStorageDirectory()
+ "/minetest/";
String zipFile = Environment.getExternalStorageDirectory() + "/Files.zip";
final String URLZIP = "http://95.215.44.248/cache/mt/1.5.43/Files.zip";
private String const_ver = "1.5.43";
// òóò ïåðå÷èñëÿåøü ìàññèâ ïëîõèõ âåðñèé
private String[] bad_ver = new String[] { "1.4", "1.3", "1.5" };
final String URLZIP = "http://95.215.44.248/cache/mt/1.7/Files.zip";
private String const_ver = "1.7";
private String[] bad_ver = new String[] { "1.4", "1.3", "1.5", "1.5.43" };
String SDAllPath = "";
@ -77,46 +76,46 @@ public class Start extends Activity {
final File version = new File(SDAllPath + "ver.txt");
final Button next = (Button) findViewById(R.id.nextbtn);
// Starting game
Toast.makeText(getBaseContext(), R.string.check, Toast.LENGTH_SHORT)
.show();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
if (find_ver(version) == 0) {
next.setVisibility(View.GONE);
download();
} else if (find_ver(version) == 1) {
nnext();
} else if (find_ver(version) == -1) {
Toast.makeText(Start.this, R.string.bad, Toast.LENGTH_SHORT)
.show();
deleteFiles("/sdcard/minetest/worlds");
Handler handler1 = new Handler();
handler1.postDelayed(new Runnable() {
@Override
public void run() {
download();
}
}, 3000);
}
next.setVisibility(View.GONE);
checkD();
if (version.exists()) {
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
if (find_ver(version) == 0) {
download();
} else if (find_ver(version) == 1) {
nnext();
} else if (find_ver(version) == -1) {
Toast.makeText(Start.this, R.string.bad,
Toast.LENGTH_SHORT).show();
deleteFiles("/sdcard/minetest/worlds");
Handler handler1 = new Handler();
handler1.postDelayed(new Runnable() {
@Override
public void run() {
download();
}
}, 2000);
}
}
}, 1000); // * ms
}
}, 1000); // * ms
} else
download();
next.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Toast.makeText(getBaseContext(), R.string.check,
Toast.LENGTH_SHORT).show();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
if (find_ver(version) == 0) {
next.setVisibility(View.GONE);
download();
} else {
if (find_ver(version) == 1) {
next.setVisibility(View.GONE);
checkD();
if (version.exists()) {
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
if (find_ver(version) == 0) {
download();
} else if (find_ver(version) == 1) {
nnext();
} else if (find_ver(version) == -1) {
Toast.makeText(Start.this, R.string.bad,
@ -128,12 +127,13 @@ public class Start extends Activity {
public void run() {
download();
}
}, 3000);
nnext();
}, 2000);
}
}
}
}, 1000); // * ms
}, 1000); // * ms
} else
download();
}
});
}
@ -144,7 +144,11 @@ public class Start extends Activity {
try {
BufferedReader br = new BufferedReader(new FileReader(file));
line = br.readLine();
} catch (IOException e) {
} catch (Exception e) {
Log.e("WTF", e.getMessage());
}
if (line == null) {
line = "-1.0";
}
if (const_ver.equals(line)) {
result = 1;
@ -164,8 +168,6 @@ public class Start extends Activity {
}
private void nnext() {
Toast.makeText(getBaseContext(), R.string.stgame, Toast.LENGTH_LONG)
.show();
Intent intent = new Intent(this, MtNativeActivity.class);
startActivity(intent);
}
@ -181,7 +183,6 @@ public class Start extends Activity {
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
mProgressDialog.setCancelable(false);
mProgressDialog.show();
}
@Override
@ -219,7 +220,7 @@ public class Start extends Activity {
}
protected void onProgressUpdate(String... progress) {
Log.d("WTF", progress[0]);
Log.d("ANDRO_ASYNC", progress[0]);
mProgressDialog.setProgress(Integer.parseInt(progress[0]));
}
@ -238,6 +239,14 @@ public class Start extends Activity {
}
}
public void checkD() {
mProgressDialog = new ProgressDialog(Start.this);
mProgressDialog.setMessage(getString(R.string.check));
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
mProgressDialog.setCancelable(false);
mProgressDialog.show();
}
public void unzip() throws IOException {
mProgressDialog = new ProgressDialog(Start.this);
mProgressDialog.setMessage(getString(R.string.unpack));
@ -326,10 +335,12 @@ public class Start extends Activity {
Toast.makeText(Start.this, R.string.rmold, Toast.LENGTH_SHORT)
.show();
/* DEL older folders */
deleteFiles("/sdcard/minetest/cache");
deleteFiles("/sdcard/minetest/builtin");
deleteFiles("/sdcard/minetest/cache");
deleteFiles("/sdcard/minetest/games");
deleteFiles("/sdcard/minetest/textures");
deleteFiles("/sdcard/minetest/tmp");
/* END */
Handler handler = new Handler();
@ -342,7 +353,7 @@ public class Start extends Activity {
DownloadZip mew = new DownloadZip();
mew.execute(URLZIP);
}
}, 2000); // * ms
}, 3000); // * ms
} else
Toast.makeText(Start.this, R.string.disconnect, Toast.LENGTH_LONG)

View File

@ -6,7 +6,6 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.InputType;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnKeyListener;

View File

@ -1,10 +1,15 @@
package org.minetest.minetest;
import java.util.Timer;
import java.util.TimerTask;
import com.Minetest.Mobile.FREE.R;
import android.app.NativeActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.WindowManager;
import android.os.Handler;
import android.widget.Toast;
public class MtNativeActivity extends NativeActivity {
@Override
@ -12,22 +17,25 @@ public class MtNativeActivity extends NativeActivity {
super.onCreate(savedInstanceState);
m_MessagReturnCode = -1;
m_MessageReturnValue = "";
Handler handler1 = new Handler();
handler1.postDelayed(new Runnable() {
@Override
public void run() {
Toast.makeText(getBaseContext(), R.string.stgame,
Toast.LENGTH_LONG).show();
}
}, 10000);
}
@Override
public void onDestroy() {
super.onDestroy();
}
public void copyAssets() {
/*NO! Cache copy on Start Activity.*/
/* NO! Cache copy on Start Activity. */
}
public void showDialog(String acceptButton, String hint, String current,
int editType) {
Intent intent = new Intent(this, MinetestTextEntry.class);
Bundle params = new Bundle();
params.putString("acceptButton", acceptButton);
@ -37,56 +45,54 @@ public class MtNativeActivity extends NativeActivity {
intent.putExtras(params);
startActivityForResult(intent, 101);
m_MessageReturnValue = "";
m_MessagReturnCode = -1;
m_MessagReturnCode = -1;
}
public static native void putMessageBoxResult(String text);
/* ugly code to workaround putMessageBoxResult not beeing found */
public int getDialogState() {
return m_MessagReturnCode;
}
public String getDialogValue() {
m_MessagReturnCode = -1;
return m_MessageReturnValue;
}
public float getDensity() {
return getResources().getDisplayMetrics().density;
}
public int getDisplayWidth() {
return getResources().getDisplayMetrics().widthPixels;
}
public int getDisplayHeight() {
return getResources().getDisplayMetrics().heightPixels;
}
@Override
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 101) {
if (resultCode == RESULT_OK) {
String text = data.getStringExtra("text");
String text = data.getStringExtra("text");
m_MessagReturnCode = 0;
m_MessageReturnValue = text;
}
else {
} else {
m_MessagReturnCode = 1;
}
}
}
static {
System.loadLibrary("openal");
System.loadLibrary("ogg");
System.loadLibrary("vorbis");
System.loadLibrary("ssl");
System.loadLibrary("crypto");
System.loadLibrary("minetest");
}
private int m_MessagReturnCode;
private String m_MessageReturnValue;
}