ref: 9b6df8a26752ddf272bb2443a0388e97b251d917
parent: ba2329a9c0cf10a27adda91e21b628377249bca2
parent: a294cad5c8ada3ada88fdc52220352d4c8a3a8e1
author: Ethan Hugg <ethanhugg@gmail.com>
date: Mon Jun 2 03:06:54 EDT 2014
Merge pull request #905 from mstorsjo/cleanup-android-projects Cleanup android test projects
--- a/codec/build/android/dec/AndroidManifest.xml
+++ b/codec/build/android/dec/AndroidManifest.xml
@@ -5,7 +5,7 @@
android:versionName="1.0">
<uses-sdk android:minSdkVersion="12"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
- <application android:icon="@drawable/icon" android:label="@string/app_name">
+ <application android:label="@string/app_name">
<activity android:name=".WelsDecTest"
android:label="@string/app_name">
<intent-filter>
--- a/codec/build/android/dec/jni/Application.mk
+++ b/codec/build/android/dec/jni/Application.mk
@@ -1,20 +1,2 @@
-# debug/release, default is release
-ifeq ($(OPTIM_debug),true)
-APP_OPTIM := debug
-else
-APP_OPTIM := release
-endif
-
-# x86/armeabi-v7a/armeabi, default is armeabi-v7a
-ifeq ($(ABI_x86),true)
-APP_ABI := x86
-else
-ifeq ($(ABI_armeabi),true)
-APP_ABI := armeabi
-else
-APP_ABI := armeabi-v7a
-endif
-endif
-
APP_STL := stlport_shared
APP_PLATFORM := android-12
binary files a/codec/build/android/dec/res/drawable-hdpi/icon.png /dev/null differ
binary files a/codec/build/android/dec/res/drawable-ldpi/icon.png /dev/null differ
--- a/codec/build/android/dec/res/layout/main.xml
+++ b/codec/build/android/dec/res/layout/main.xml
@@ -1,21 +1,21 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal">"
- <Button
- android:id="@+id/cfg"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Load bitstreams" />
- <Button
- android:id="@+id/buttonSW"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Test" />
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+ <Button
+ android:id="@+id/cfg"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Load bitstreams" />
+ <Button
+ android:id="@+id/buttonSW"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Test" />
</LinearLayout>
-</LinearLayout>
+</LinearLayout>
--- a/codec/build/android/dec/res/values/strings.xml
+++ b/codec/build/android/dec/res/values/strings.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <string name="app_name">WelsDecoderTest</string>
-</resources>
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">WelsDecoderTest</string>
+</resources>
--- a/codec/build/android/enc/AndroidManifest.xml
+++ b/codec/build/android/enc/AndroidManifest.xml
@@ -5,7 +5,7 @@
android:versionName="1.0">
<uses-sdk android:minSdkVersion="12"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
- <application android:icon="@drawable/icon" android:label="@string/app_name">
+ <application android:label="@string/app_name">
<activity android:name=".WelsEncTest"
android:label="@string/app_name">
<intent-filter>
--- a/codec/build/android/enc/jni/Application.mk
+++ b/codec/build/android/enc/jni/Application.mk
@@ -1,20 +1,2 @@
-# debug/release, default is release
-ifeq ($(OPTIM_debug),true)
-APP_OPTIM := debug
-else
-APP_OPTIM := release
-endif
-
-# x86/armeabi-v7a/armeabi, default is armeabi-v7a
-ifeq ($(ABI_x86),true)
-APP_ABI := x86
-else
-ifeq ($(ABI_armeabi),true)
-APP_ABI := armeabi
-else
-APP_ABI := armeabi-v7a
-endif
-endif
-
APP_STL := stlport_shared
APP_PLATFORM := android-12
binary files a/codec/build/android/enc/res/drawable-hdpi/icon.png /dev/null differ
binary files a/codec/build/android/enc/res/drawable-ldpi/icon.png /dev/null differ
--- a/codec/build/android/enc/res/layout/main.xml
+++ b/codec/build/android/enc/res/layout/main.xml
@@ -1,21 +1,21 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal">"
- <Button
- android:id="@+id/cfg"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Load bitstreams" />
- <Button
- android:id="@+id/buttonSW"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Test" />
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+ <Button
+ android:id="@+id/cfg"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Load bitstreams" />
+ <Button
+ android:id="@+id/buttonSW"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Test" />
</LinearLayout>
-</LinearLayout>
+</LinearLayout>
--- a/codec/build/android/enc/res/values/strings.xml
+++ b/codec/build/android/enc/res/values/strings.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <string name="app_name">WelsEncoderTest</string>
-</resources>
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">WelsEncoderTest</string>
+</resources>
--- a/test/build/android/AndroidManifest.xml
+++ b/test/build/android/AndroidManifest.xml
@@ -13,7 +13,6 @@
<application
android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
--- a/test/build/android/jni/Application.mk
+++ b/test/build/android/jni/Application.mk
@@ -1,20 +1,2 @@
-# debug/release, default is release
-ifeq ($(OPTIM_debug),true)
-APP_OPTIM := debug
-else
-APP_OPTIM := release
-endif
-
-# x86/armeabi-v7a/armeabi, default is armeabi-v7a
-ifeq ($(ABI_x86),true)
-APP_ABI := x86
-else
-ifeq ($(ABI_armeabi),true)
-APP_ABI := armeabi
-else
-APP_ABI := armeabi-v7a
-endif
-endif
-
APP_STL := stlport_shared
APP_PLATFORM := android-12
--- a/test/build/android/jni/codec_unittest.cpp
+++ b/test/build/android/jni/codec_unittest.cpp
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <jni.h>
+#include <unistd.h>
#include <android/log.h>
#define LOG_TAG "codec_unittest"
@@ -10,13 +11,14 @@
int CodecUtMain(int argc, char** argv);
extern "C"
JNIEXPORT void JNICALL Java_com_cisco_codec_unittest_MainActivity_DoUnittest
-(JNIEnv* env, jobject thiz,jstring jspath) {
+(JNIEnv* env, jobject thiz, jstring directory, jstring jspath) {
/**************** Add the native codes/API *****************/
char* argv[2];
int argc = 2;
argv[0] = (char*) ("codec_unittest.exe");
argv[1] = (char*) ((*env).GetStringUTFChars (jspath,NULL));
- LOGI ("PATH:",+argv[1]);
+ chdir((*env).GetStringUTFChars (directory, NULL));
+ LOGI ("PATH: %s", argv[1]);
LOGI ("Start to run JNI module!+++");
CodecUtMain(argc,argv);
LOGI ("End to run JNI module!+++");
binary files a/test/build/android/res/drawable-hdpi/ic_launcher.png /dev/null differ
binary files a/test/build/android/res/drawable-mdpi/ic_launcher.png /dev/null differ
binary files a/test/build/android/res/drawable-xhdpi/ic_launcher.png /dev/null differ
binary files a/test/build/android/res/drawable-xxhdpi/ic_launcher.png /dev/null differ
--- a/test/build/android/res/layout/activity_main.xml
+++ b/test/build/android/res/layout/activity_main.xml
@@ -1,19 +1,19 @@
-<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:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.cisco.codec.unittest.MainActivity" >
-
- <TextView
- android:id="@+id/status_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:text="@string/hello_world" />
-
-</RelativeLayout>
-
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin"
+ tools:context="com.cisco.codec.unittest.MainActivity" >
+
+ <TextView
+ android:id="@+id/status_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:text="@string/hello_world" />
+
+</RelativeLayout>
+
--- a/test/build/android/res/menu/main.xml
+++ /dev/null
@@ -1,10 +1,0 @@
-<menu xmlns:android="http://schemas.android.com/apk/res/android" >
-
-
- <item
- android:id="@+id/action_settings"
- android:orderInCategory="100"
- android:title="@string/action_settings"
- android:showAsAction="never"/>
-
-</menu>
--- a/test/build/android/res/values-v11/styles.xml
+++ b/test/build/android/res/values-v11/styles.xml
@@ -1,11 +1,11 @@
-<resources>
-
- <!--
+<resources>
+
+ <!--
Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light">
- <!-- API 11 theme customizations can go here. -->
- </style>
-
-</resources>
+ AppBaseTheme from res/values/styles.xml on API 11+ devices.
+ -->
+ <style name="AppBaseTheme" parent="android:Theme.Light">
+ <!-- API 11 theme customizations can go here. -->
+ </style>
+
+</resources>
--- a/test/build/android/res/values-w820dp/dimens.xml
+++ b/test/build/android/res/values-w820dp/dimens.xml
@@ -1,10 +1,10 @@
-<resources>
-
- <!--
+<resources>
+
+ <!--
Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
- would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
- -->
- <dimen name="activity_horizontal_margin">64dp</dimen>
-
-</resources>
+ would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
+ -->
+ <dimen name="activity_horizontal_margin">64dp</dimen>
+
+</resources>
--- a/test/build/android/src/com/cisco/codec/unittest/MainActivity.java
+++ b/test/build/android/src/com/cisco/codec/unittest/MainActivity.java
@@ -1,81 +1,81 @@
-package com.cisco.codec.unittest;
-
-
-import android.os.Bundle;
-import android.app.Activity;
-import android.view.Menu;
-import android.view.View;
-import android.util.Log;
-import android.widget.TextView;
-import android.os.Build;
-import android.os.Process;
-
-public class MainActivity extends Activity {
-
- private TextView mStatusView;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
-
- mStatusView = (TextView)findViewById(R.id.status_view);
-
- runUnitTest();
-
- }
-
- @Override
- public void onDestroy()
- {
- Process.killProcess(Process.myPid());
- }
-
-
-
- public void runUnitTest()
- {
- Thread thread = new Thread() {
-
- public void run()
- {
- Log.i("codec_unittest","codec unittest begin");
- CharSequence text = "Running...";
- if(mStatusView !=null)
- {
- mStatusView.setText(text);
- }
-
-// String path = getIntent().getStringExtra("path");
-// if (path.length() <=0)
-// {
-// path = "/sdcard/codec_unittest.xml";
-// }
- String path = "/sdcard/codec_unittest.xml";
- Log.i("codec_unittest","codec unittest runing @"+path);
- DoUnittest(path);
- Log.i("codec_unittest","codec unittest end");
- Process.killProcess(Process.myPid());
- finish();
- }
-
- };
- thread.start();
- }
-
- static{
- try{
- System.loadLibrary("stlport_shared");
- //System.loadLibrary("openh264");
- System.loadLibrary("ut");
- System.loadLibrary("utDemo");
-
-
- }
- catch(Exception e){Log.v("codec_unittest","Load library failed");}
-
- }
-
- public native void DoUnittest(String path);
-
-}
+package com.cisco.codec.unittest;
+
+
+import android.os.Bundle;
+import android.app.Activity;
+import android.view.Menu;
+import android.view.View;
+import android.util.Log;
+import android.widget.TextView;
+import android.os.Build;
+import android.os.Process;
+
+public class MainActivity extends Activity {
+
+ private TextView mStatusView;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ mStatusView = (TextView)findViewById(R.id.status_view);
+
+ runUnitTest();
+
+ }
+
+ @Override
+ public void onDestroy()
+ {
+ Process.killProcess(Process.myPid());
+ }
+
+
+
+ public void runUnitTest()
+ {
+ Thread thread = new Thread() {
+
+ public void run()
+ {
+ Log.i("codec_unittest","codec unittest begin");
+ CharSequence text = "Running...";
+ if(mStatusView !=null)
+ {
+ mStatusView.setText(text);
+ }
+
+// String path = getIntent().getStringExtra("path");
+// if (path.length() <=0)
+// {
+// path = "/sdcard/codec_unittest.xml";
+// }
+ String path = "/sdcard/codec_unittest.xml";
+ Log.i("codec_unittest","codec unittest runing @"+path);
+ DoUnittest("/sdcard", path);
+ Log.i("codec_unittest","codec unittest end");
+ Process.killProcess(Process.myPid());
+ finish();
+ }
+
+ };
+ thread.start();
+ }
+
+ static{
+ try{
+ System.loadLibrary("stlport_shared");
+ //System.loadLibrary("openh264");
+ System.loadLibrary("ut");
+ System.loadLibrary("utDemo");
+
+
+ }
+ catch(Exception e){Log.v("codec_unittest","Load library failed");}
+
+ }
+
+ public native void DoUnittest(String directory, String path);
+
+}