From: <kro...@us...> - 2010-11-23 21:33:04
|
Revision: 3970 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3970&view=rev Author: kroko_koenig Date: 2010-11-23 21:32:56 +0000 (Tue, 23 Nov 2010) Log Message: ----------- add Android source (very early stage...) Added Paths: ----------- trunk/plugins/AndroidRemote/Android/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.classpath trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.project trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.jdt.core.prefs trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveDown.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveLeft.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveRight.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveUp.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_selectItem.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/default.properties trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/accept_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/close_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/down_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/music_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/next_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pictures_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/play.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/remote_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/splash.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/up_icon.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/videos_logo.png trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/attributes.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.classpath =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.classpath (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.classpath 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="gen"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.project =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.project (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.project 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>MediaPortalRemote</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.ApkBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>com.android.ide.eclipse.adt.AndroidNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/.settings/org.eclipse.jdt.core.prefs 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,12 @@ +#Thu Nov 18 22:54:50 CET 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/AndroidManifest.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="mediaportal.remote" android:versionCode="1" + android:versionName="1.0"> + <application android:icon="@drawable/icon" android:label="@string/app_name"> + <activity android:name=".splash" android:label="@string/app_name"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + <activity android:name=".main" android:label="@string/app_name"> + <intent-filter> + <action android:name="android.intent.action.DEFAULT" /> + <category android:name="android.intent.category.VIEW" /> + </intent-filter> + </activity> + <activity android:name=".remote"></activity> + <activity android:name=".pictures"></activity> + <activity android:name=".picturesfullscreen"></activity> + <activity android:name=".setup"></activity> + </application> + <uses-sdk android:minSdkVersion="3" /> + + <uses-permission android:name="android.permission.INTERNET"></uses-permission> +</manifest> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveDown.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveDown.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveDown.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_MOVE_DOWN</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveLeft.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveLeft.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveLeft.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_MOVE_LEFT</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveRight.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveRight.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveRight.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_MOVE_RIGHT</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveUp.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveUp.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_moveUp.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_MOVE_UP</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_prevMenu.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_PREVIOUS_MENU</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_selectItem.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_selectItem.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/assets/cmd_selectItem.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<message> + <command>ACTION_SELECT_ITEM</command> +</message> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/default.properties =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/default.properties (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/default.properties 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "build.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-3 Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/gen/mediaportal/remote/R.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,83 @@ +/* AUTO-GENERATED FILE. DO NOT MODIFY. + * + * This class was automatically generated by the + * aapt tool from the resource data it found. It + * should not be modified by hand. + */ + +package mediaportal.remote; + +public final class R { + public static final class attr { + } + public static final class drawable { + public static final int accept_icon=0x7f020000; + public static final int back=0x7f020001; + public static final int back_icon=0x7f020002; + public static final int close_icon=0x7f020003; + public static final int down_icon=0x7f020004; + public static final int icon=0x7f020005; + public static final int music_logo=0x7f020006; + public static final int next_icon=0x7f020007; + public static final int pictures_logo=0x7f020008; + public static final int play=0x7f020009; + public static final int remote_logo=0x7f02000a; + public static final int splash=0x7f02000b; + public static final int up_icon=0x7f02000c; + public static final int videos_logo=0x7f02000d; + } + public static final class id { + public static final int Button01=0x7f050006; + public static final int GridView01=0x7f050007; + public static final int ImageView01=0x7f050008; + public static final int MainButton1=0x7f050000; + public static final int MainButton2=0x7f050001; + public static final int MainButton3=0x7f050002; + public static final int MainButton4=0x7f050003; + public static final int btnCancel=0x7f05000b; + public static final int btnDown=0x7f05000d; + public static final int btnLeft=0x7f05000f; + public static final int btnOk=0x7f05000c; + public static final int btnReturn=0x7f05000a; + public static final int btnReturnSetup=0x7f050012; + public static final int btnRight=0x7f05000e; + public static final int btnStartSetup=0x7f050004; + public static final int btnUp=0x7f050009; + public static final int server_ip=0x7f050010; + public static final int server_port=0x7f050011; + public static final int widget0=0x7f050005; + } + public static final class layout { + public static final int main=0x7f030000; + public static final int pictures=0x7f030001; + public static final int picturesfullscreen=0x7f030002; + public static final int remote=0x7f030003; + public static final int setup=0x7f030004; + public static final int splash=0x7f030005; + } + public static final class string { + public static final int app_name=0x7f040001; + public static final int hello=0x7f040000; + } + public static final class styleable { + /** Attributes that can be used with a Gallery1. + <p>Includes the following attributes:</p> + <table> + <colgroup align="left" /> + <colgroup align="left" /> + <tr><th>Attribute</th><th>Description</th></tr> + <tr><td><code>{@link #Gallery1_android_galleryItemBackground mediaportal.remote:android_galleryItemBackground}</code></td><td></td></tr> + </table> + @see #Gallery1_android_galleryItemBackground + */ + public static final int[] Gallery1 = { + 0x0101004c + }; + /** + <p>This symbol is the offset where the {@link mediaportal.remote.R.attr#android_galleryItemBackground} + attribute's value can be found in the {@link #Gallery1} array. + @attr name android:android_galleryItemBackground + */ + public static final int Gallery1_android_galleryItemBackground = 0; + }; +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/accept_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/accept_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/back_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/close_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/close_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/down_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/down_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/music_logo.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/music_logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/next_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/next_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pictures_logo.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/pictures_logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/play.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/play.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/remote_logo.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/remote_logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/splash.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/splash.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/up_icon.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/up_icon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/videos_logo.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/drawable/videos_logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/main.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:background="@drawable/back" + > + +<Button android:id="@+id/MainButton1" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:background="@drawable/pictures_logo" /> + +<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> + +<Button android:id="@+id/MainButton2" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:background="@drawable/music_logo" /> + +<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> + +<Button android:id="@+id/MainButton3" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:background="@drawable/videos_logo" /> + +<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> + +<Button android:id="@+id/MainButton4" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:background="@drawable/remote_logo" /> + +<View android:layout_height="2dp" android:layout_width="fill_parent" android:background="#000"/> + +<Button + android:id="@+id/btnStartSetup" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Setup"></Button> + +</LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/pictures.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,24 @@ +<AbsoluteLayout +android:id="@+id/widget0" +android:layout_width="fill_parent" +android:layout_height="wrap_content" +android:background="@drawable/back" +xmlns:android="http://schemas.android.com/apk/res/android" +> +<Button android:text="Return" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> + +<GridView android:layout_y="60dip" + android:layout_x="0dip" + android:id="@+id/GridView01" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:columnWidth="90dp" + android:numColumns="auto_fit" + android:verticalSpacing="10dp" + android:horizontalSpacing="10dp" + android:stretchMode="columnWidth" + android:gravity="center" + > + </GridView> +</AbsoluteLayout> + Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/picturesfullscreen.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:background="@drawable/back" + > + +<ImageView android:id="@+id/ImageView01" + android:layout_width="wrap_content" + android:layout_height="wrap_content"></ImageView> +</LinearLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/remote.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="utf-8"?> +<AbsoluteLayout +android:id="@+id/widget0" +android:layout_width="fill_parent" +android:layout_height="fill_parent" +android:background="@drawable/back" +xmlns:android="http://schemas.android.com/apk/res/android" +> +<Button +android:id="@+id/btnUp" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/up_icon" +android:layout_x="130px" +android:layout_y="100px" +> +</Button> +<Button +android:id="@+id/btnReturn" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:text="Return" +android:layout_x="10px" +android:layout_y="8px" +> +</Button> +<Button +android:id="@+id/btnCancel" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/close_icon" +android:layout_x="260px" +android:layout_y="8px" +> +</Button> +<Button +android:id="@+id/btnOk" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/accept_icon" +android:layout_x="130px" +android:layout_y="175px" +> +</Button> +<Button +android:id="@+id/btnDown" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/down_icon" +android:layout_x="130px" +android:layout_y="250px" +> +</Button> +<Button +android:id="@+id/btnRight" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/next_icon" +android:layout_x="205px" +android:layout_y="175px" +> +</Button> +<Button +android:id="@+id/btnLeft" +android:layout_width="wrap_content" +android:layout_height="wrap_content" +android:background="@drawable/back_icon" +android:layout_x="55px" +android:layout_y="175px" +></Button> + +</AbsoluteLayout> \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/setup.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,32 @@ +<?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" + android:padding="15dip" + android:background="@drawable/back"> +<TextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="MediaPortal IP"></TextView> +<EditText android:id="@+id/server_ip" + android:layout_height="wrap_content" + android:layout_width="fill_parent" + android:text="192.168.0.30" + android:inputType="text"></EditText> +<TextView + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="MediaPortal Port"></TextView> +<EditText android:id="@+id/server_port" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:text="8200" android:inputType="number|numberSigned"></EditText> +<Button + android:id="@+id/btnReturnSetup" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Return"></Button> + +</LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/layout/splash.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent"> + <ImageView + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:src="@drawable/splash" + android:scaleType="fitXY"> + </ImageView> +</LinearLayout> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/attributes.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/attributes.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/attributes.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <declare-styleable name="Gallery1"> + <attr name="android:galleryItemBackground"/> + </declare-styleable> +</resources> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/res/values/strings.xml 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="hello">Hello World, main!</string> + <string name="app_name">MediaPortal Remote</string> +</resources> Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/ImageAdapter.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,159 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.xml.sax.ContentHandler; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; + +import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.view.View; +import android.view.ViewGroup; +import android.widget.*; + +import mediaportal.remote.httpHandler; + + +public class ImageAdapter extends BaseAdapter { + private Context mContext; + + public ImageAdapter(Context c) { + mContext = c; + } + + public int getCount() { + directoryItems myItems = directoryXmlHandler.getSitesList(); + return myItems.gettitle().size(); + } + + public Object getItem(int position) { + return null; + } + + public long getItemId(int position) { + return 0; + } + + // create a new ImageView for each item referenced by the Adapter + public View getView(int position, View convertView, ViewGroup parent) { + ImageView imageView; + if (convertView == null) { // if it's not recycled, initialize some attributes + imageView = new ImageView(mContext); + imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); + imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); + imageView.setPadding(8, 8, 8, 8); + } else { + imageView = (ImageView) convertView; + } + + imageView.setImageBitmap(bmImg[position]); + return imageView; + } + + public static Bitmap[] bmImg; + public static Bitmap downloadFile(String fileUrl){ + URL myFileUrl =null; + try { + myFileUrl= new URL(fileUrl); + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + try { + HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection(); + conn.setReadTimeout(3000); + conn.setDoInput(true); + conn.connect(); + //int length = conn.getContentLength(); + InputStream is = conn.getInputStream(); + + SAXParserFactory spf = SAXParserFactory.newInstance(); + SAXParser sp = null; + try { + sp = spf.newSAXParser(); + } catch (ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + XMLReader reader = null; + try { + reader = sp.getXMLReader(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + directoryXmlHandler handler = new directoryXmlHandler(); + + reader.setContentHandler(handler); + try { + reader.parse(new InputSource(is)); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + is.close(); + sp.reset(); + + directoryItems myItems = directoryXmlHandler.getSitesList(); + bmImg = new Bitmap[myItems.gettitle().size()]; + + httpHandler h = new httpHandler(); + + for (int i = 0; i < myItems.gettitle().size(); i++) + { + String tit = myItems.gettitle().get(i); + Boolean fold = myItems.getIsFolder().get(i); + + tit = tit + ".thb"; + bmImg[i] = h.DownloadImage("http://192.168.0.30:8200/pictures/" + tit); + } + + + //bmImg = BitmapFactory.decodeStream(is); + return null; + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } + public static Bitmap ddownloadFile2(String fileUrl){ + URL myFileUrl =null; + try { + myFileUrl= new URL(fileUrl); + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + try { + HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection(); + conn.setDoInput(true); + conn.connect(); + //int length = conn.getContentLength(); + InputStream is = conn.getInputStream(); + + Bitmap myImg = BitmapFactory.decodeStream(is); + return myImg; + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return null; + } +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryItems.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,26 @@ +package mediaportal.remote; + +import java.util.ArrayList; + +/** Contains getter and setter method for variables */ +public class directoryItems { + + /** Variables */ + private ArrayList<String> title = new ArrayList<String>(); + private ArrayList<Boolean> isFolder = new ArrayList<Boolean>(); + + public ArrayList<String> gettitle() { + return title; + } + public void settitle(String title) { + this.title.add(title); + } + + public ArrayList<Boolean> getIsFolder() { + return isFolder; + } + public void setIsFolder(Boolean isFolder) { + this.isFolder.add(isFolder); + } + +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/directoryXmlHandler.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,68 @@ +package mediaportal.remote; + +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +public class directoryXmlHandler extends DefaultHandler { + Boolean currentElement = false; + String currentValue = null; + + public static directoryItems itemList = null; + + public static directoryItems getSitesList() { + return itemList; + } + + public static void setSitesList(directoryItems directoryList) { + directoryXmlHandler.itemList = directoryList; + } + + /** + * Called when tag starts ( example:- <name>AndroidPeople</name> -- <name> ) + */ + @Override + public void startElement(String uri, String localName, String qName, + Attributes attributes) throws SAXException { + currentElement = true; + + if (localName == "Directory") { + itemList = new directoryItems(); + } + } + + /** + * Called when tag closing ( example:- <name>AndroidPeople</name> -- </name> ) + */ + @Override + public void endElement(String uri, String localName, String qName) + throws SAXException { + + currentElement = false; + + /** set value */ + if (localName == "Folder") { + itemList.setIsFolder(true); + itemList.settitle(currentValue); + } + if (localName == "File") { + itemList.setIsFolder(false); + itemList.settitle(currentValue); + } + } + + /** + * Called to get tag characters ( example:- <name>AndroidPeople</name> -- to get + * AndroidPeople Character ) + */ + @Override + public void characters(char[] ch, int start, int length) + throws SAXException { + if (currentElement) { + currentValue = new String(ch, start, length); + currentElement = false; + } + + } + +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/httpHandler.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,73 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; + +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.os.Bundle; +import android.os.Message; + +public class httpHandler { + + public httpHandler() { + + } + + public InputStream openHttpConnection(String urlStr) { + InputStream in = null; + int resCode = -1; + + try { + URL url = new URL(urlStr); + URLConnection urlConn = url.openConnection(); + + if (!(urlConn instanceof HttpURLConnection)) { + throw new IOException("URL is not an Http URL"); + } + + HttpURLConnection httpConn = (HttpURLConnection) urlConn; + httpConn.setAllowUserInteraction(false); + httpConn.setInstanceFollowRedirects(true); + httpConn.setRequestMethod("GET"); + httpConn.connect(); + resCode = httpConn.getResponseCode(); + + if (resCode == HttpURLConnection.HTTP_OK) { + in = httpConn.getInputStream(); + } + + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + + return in; + } + + public Bitmap DownloadImage(String urlStr) { + + final String url = urlStr; + Bitmap bitmap = null; + + InputStream in = null; + + try { + in = openHttpConnection(url); + bitmap = BitmapFactory.decodeStream(in); + if (in != null) + in.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + + return bitmap; + + } + +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/main.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,54 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.*; +import android.content.SharedPreferences; + +public class main extends Activity { + + public static String HttpServer; + public static String HttpPort; + + public static String SelectedPicture; + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + + SharedPreferences settings = getPreferences(MODE_PRIVATE); + + HttpServer = settings.getString("Server", "192.168.0.30"); + HttpPort = settings.getString("Port", "8200"); + + Button btnPictures = (Button) findViewById(R.id.MainButton1); + btnPictures.setOnClickListener(new View.OnClickListener(){ + public void onClick(View view) { + Intent myIntent = new Intent(view.getContext(), pictures.class); + startActivityForResult(myIntent, 0); + } + }); + + Button btnRemote = (Button) findViewById(R.id.MainButton4); + btnRemote.setOnClickListener(new View.OnClickListener(){ + public void onClick(View view) { + Intent myIntent = new Intent(view.getContext(), remote.class); + startActivityForResult(myIntent, 0); + } + }); + + Button btnSetup = (Button) findViewById(R.id.btnStartSetup); + btnSetup.setOnClickListener(new View.OnClickListener(){ + public void onClick(View view) { + Intent myIntent = new Intent(view.getContext(), setup.class); + startActivityForResult(myIntent, 0); + } + }); + + } +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/pictures.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,47 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import mediaportal.remote.ImageAdapter; + +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; +import android.widget.Button; +import android.widget.GridView; +import android.widget.AdapterView.OnItemClickListener; +import android.widget.Toast; + +public class pictures extends Activity { + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.pictures); + + ImageAdapter.downloadFile("http://192.168.0.30:8200/pictures/2010/2008%2001%2023"); + + GridView gridview = (GridView) findViewById(R.id.GridView01); + gridview.setAdapter(new ImageAdapter(this)); + + Button ret = (Button) findViewById(R.id.Button01); + ret.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent intent = new Intent(); + setResult(RESULT_OK, intent); + finish(); + } + }); + + gridview.setOnItemClickListener(new OnItemClickListener() { + public void onItemClick(AdapterView<?> parent, View v, int position, long id) + { + main.SelectedPicture = "http://192.168.0.30:8200/pictures/2010/2008%2001%2023/sdc10839.jpg"; + Intent myIntent = new Intent(v.getContext(), picturesfullscreen.class); + startActivityForResult(myIntent, 0); + } + }); + } +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/picturesfullscreen.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,32 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.ImageView; + +public class picturesfullscreen extends Activity { + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.picturesfullscreen); + + httpHandler h = new httpHandler(); + + ImageView imagev = (ImageView) findViewById(R.id.ImageView01); + imagev.setImageBitmap(h.DownloadImage(main.SelectedPicture)); + + imagev.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent intent = new Intent(); + setResult(RESULT_OK, intent); + finish(); + } + }); + + } +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/remote.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,130 @@ +package mediaportal.remote; + +import java.io.IOException; +import java.io.InputStream; + +import mediaportal.remote.R; + +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.params.BasicHttpParams; +import org.apache.http.params.HttpConnectionParams; +import org.apache.http.params.HttpParams; + +import android.app.Activity; +import android.content.Intent; +import android.content.res.AssetManager; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.Toast; + +public class remote extends Activity { + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.remote); + + Button ret = (Button) findViewById(R.id.btnReturn); + ret.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent intent = new Intent(); + setResult(RESULT_OK, intent); + finish(); + } + }); + + Button can = (Button) findViewById(R.id.btnCancel); + can.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("prevMenu"); + } + }); + + Button left = (Button) findViewById(R.id.btnLeft); + left.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveLeft"); + } + }); + + Button right = (Button) findViewById(R.id.btnRight); + right.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveRight"); + } + }); + + Button up = (Button) findViewById(R.id.btnUp); + up.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveUp"); + } + }); + + Button down = (Button) findViewById(R.id.btnDown); + down.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("moveDown"); + } + }); + + Button ok = (Button) findViewById(R.id.btnOk); + ok.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + PostCommand("selectItem"); + } + }); + } + + public void PostCommand(String button) { + + HttpParams httpParameters = new BasicHttpParams(); + HttpConnectionParams.setConnectionTimeout(httpParameters, 3000); + HttpConnectionParams.setSoTimeout(httpParameters, 3000); + + HttpClient httpclient = new DefaultHttpClient(httpParameters); + HttpPost httppost = new HttpPost("http://" + main.HttpServer + ":" + + main.HttpPort); + + try { + + AssetManager assetManager = getAssets(); + + InputStream inputStream = null; + inputStream = assetManager.open("cmd_" + button + ".xml"); + + int x = inputStream.read(); + + String xml = ""; + + while (x != -1) { + xml = xml + (char) x; + x = inputStream.read(); + } + + StringEntity se = new StringEntity(xml, "UTF-8"); + se.setContentType("application/atom+xml"); + + httppost.setEntity(se); + + //HttpResponse response; + //response = httpclient.execute(httppost); + httpclient.execute(httppost); + + } catch (ClientProtocolException e) { + Toast.makeText(remote.this, "ERROR CONNECTION SERVER", + Toast.LENGTH_LONG).show(); + e.printStackTrace(); + } catch (IOException e) { + Toast.makeText(remote.this, "TIME OUT SERVER", Toast.LENGTH_LONG) + .show(); + e.printStackTrace(); + } + } + +} \ No newline at end of file Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/setup.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,50 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.os.Handler; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; + +public class setup extends Activity { + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle icicle) { + super.onCreate(icicle); + setContentView(R.layout.setup); + + SharedPreferences settings = getPreferences(MODE_PRIVATE); + EditText txt1 = (EditText)findViewById(R.id.server_ip); + EditText txt2 = (EditText)findViewById(R.id.server_port); + + txt1.setText(settings.getString("Server", "192.168.0.30")); + txt2.setText(settings.getString("Port", "8200")); + + Button ret = (Button) findViewById(R.id.btnReturnSetup); + ret.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + + EditText txt1 = (EditText)findViewById(R.id.server_ip); + EditText txt2 = (EditText)findViewById(R.id.server_port); + + SharedPreferences settings = getPreferences(MODE_PRIVATE); + + SharedPreferences.Editor prefEditor = settings.edit(); + prefEditor.putString("Server", txt1.getEditableText().toString()); + prefEditor.putString("Port", txt2.getEditableText().toString()); + prefEditor.commit(); + + + Intent intent = new Intent(); + setResult(RESULT_OK, intent); + finish(); + } + }); + + } +} Added: trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java =================================================================== --- trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java (rev 0) +++ trunk/plugins/AndroidRemote/Android/MediaPortalRemote/src/mediaportal/remote/splash.java 2010-11-23 21:32:56 UTC (rev 3970) @@ -0,0 +1,45 @@ +package mediaportal.remote; + +import mediaportal.remote.R; +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.os.Handler; + +public class splash extends Activity { + + // =========================================================== + // Fields + // =========================================================== + + private final int SPLASH_DISPLAY_LENGHT = 3000; + + // =========================================================== + // "Constructors" + // =========================================================== + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle icicle) { + super.onCreate(icicle); + setContentView(R.layout.splash); + + /* + * New Handler to start the Menu-Activity + * + * and close this Splash-Screen after some seconds. + */ + + new Handler().postDelayed(new Runnable() { + + // @Override + public void run() { + + /* Create an Intent that will start the main-Activity. */ + Intent mainIntent = new Intent(splash.this, main.class); + splash.this.startActivity(mainIntent); + splash.this.finish(); + } + }, SPLASH_DISPLAY_LENGHT); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |