Link to OpenCV website updated. Full Manager version added to UI. Screen orientation fixed.

This commit is contained in:
Alexander Smorkalov 2012-09-14 17:44:08 +04:00
parent d55e114f96
commit dc5c7ee68f
4 changed files with 67 additions and 51 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.opencv.engine"
android:versionCode="14"
android:versionName="1.4" >
android:versionCode="15"
android:versionName="1.5" >
<uses-sdk android:minSdkVersion="8" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
@ -17,7 +17,10 @@
</intent-filter>
</service>
<activity android:name="org.opencv.engine.manager.ManagerActivity" android:label="@string/app_name" >
<activity
android:name="org.opencv.engine.manager.ManagerActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

View File

@ -16,7 +16,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:text="OpenCV is Open Computer Vision library. OpenCV Manager provides the best version of the OpenCV for your hardware. See www.opencv.org for details."
android:text="OpenCV is Open Computer Vision library. OpenCV Manager provides the best version of the OpenCV for your hardware. See opencv.org for details."
android:textAppearance="?android:attr/textAppearanceSmall" />
<LinearLayout

View File

@ -16,7 +16,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:text="OpenCV library is used by other applications for image enhancement, panorama stitching, object detection, recognition and tracking and so on. OpenCV Manager provides the best version of the OpenCV for your hardware. See www.opencv.org for details."
android:text="OpenCV library is used by other applications for image enhancement, panorama stitching, object detection, recognition and tracking and so on. OpenCV Manager provides the best version of the OpenCV for your hardware. See opencv.org for details."
android:textAppearance="?android:attr/textAppearanceMedium" />
<LinearLayout

View File

@ -17,6 +17,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
@ -43,6 +44,15 @@ public class ManagerActivity extends Activity
TextView OsVersionView = (TextView)findViewById(R.id.OsVersionValue);
OsVersionView.setText(Build.VERSION.CODENAME + " (" + Build.VERSION.RELEASE + "), API " + Build.VERSION.SDK_INT);
try {
PackageInfo packageInfo = getPackageManager().getPackageInfo(this.getPackageName(), 0);
ManagerVersion = packageInfo.versionName;
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
ManagerVersion = "N/A";
e.printStackTrace();
}
mInstalledPackageView = (ListView)findViewById(R.id.InstalledPackageList);
mMarket = new MarketConnector(this);
@ -201,6 +211,8 @@ public class ManagerActivity extends Activity
protected MarketConnector mMarket;
protected AlertDialog mActionDialog;
protected HashMap<String,String> mActivePackageMap = new HashMap<String, String>();
protected int ManagerApiLevel = 0;
protected String ManagerVersion;
protected BroadcastReceiver mPackageChangeReciever = new BroadcastReceiver() {
@ -220,15 +232,16 @@ public class ManagerActivity extends Activity
}
public void onServiceConnected(ComponentName name, IBinder service) {
TextView EngineVersionView = (TextView)findViewById(R.id.EngineVersionValue);
OpenCVEngineInterface EngineService = OpenCVEngineInterface.Stub.asInterface(service);
try {
EngineVersionView.setText("" + EngineService.getEngineVersion());
ManagerApiLevel = EngineService.getEngineVersion();
} catch (RemoteException e) {
EngineVersionView.setText("not avaliable");
e.printStackTrace();
}
TextView EngineVersionView = (TextView)findViewById(R.id.EngineVersionValue);
EngineVersionView.setText(ManagerVersion);
try {
String path = EngineService.getLibPathByVersion("2.4");
Log.d(TAG, "2.4 -> " + path);