From: jiri hubacek Date: Sat, 31 Jan 2015 19:51:17 +0000 (+0100) Subject: Simplified approach to write application. X-Git-Url: https://rtime.felk.cvut.cz/gitweb/orte.git/commitdiff_plain/d12ec5819453e323a7ee14b30d0ed1118fb7ed8e Simplified approach to write application. - no need for fragments - no need for complex approach to backward compatibility - usable drawables choosen - cs language added - help added - settings added --- diff --git a/orte/contrib/shape_android/.gitignore b/orte/contrib/shape_android/.gitignore index 943202a..5808629 100644 --- a/orte/contrib/shape_android/.gitignore +++ b/orte/contrib/shape_android/.gitignore @@ -14,6 +14,8 @@ gen/ libs/ obj/ +.settings/ + # Gradle files .gradle/ build/ diff --git a/orte/contrib/shape_android/AndroidManifest.xml b/orte/contrib/shape_android/AndroidManifest.xml index 6b0fcf3..2aa7a53 100644 --- a/orte/contrib/shape_android/AndroidManifest.xml +++ b/orte/contrib/shape_android/AndroidManifest.xml @@ -1,32 +1,40 @@ + android:versionName="1.2" > - - - - + + + + - + android:name=".PublisherActivity" + android:configChanges="screenSize|orientation" + android:label="@string/title_activity_publisher" > + + + + + diff --git a/orte/contrib/shape_android/build.xml b/orte/contrib/shape_android/build.xml deleted file mode 100644 index a64a1ea..0000000 --- a/orte/contrib/shape_android/build.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/orte/contrib/shape_android/lint.xml b/orte/contrib/shape_android/lint.xml deleted file mode 100644 index ee0eead..0000000 --- a/orte/contrib/shape_android/lint.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/orte/contrib/shape_android/project.properties b/orte/contrib/shape_android/project.properties index f970a6c..0675cec 100644 --- a/orte/contrib/shape_android/project.properties +++ b/orte/contrib/shape_android/project.properties @@ -12,5 +12,4 @@ # Project target. target=android-15 -android.library.reference.1=../../../../../workspace/appcompat_v7 -android.library.reference.2=../../libaorte +android.library.reference.1=../../dev/orte/orte/libaorte diff --git a/orte/contrib/shape_android/res/drawable-hdpi/ic_action_cast.png b/orte/contrib/shape_android/res/drawable-hdpi/ic_action_cast.png deleted file mode 100644 index 066ddd5..0000000 Binary files a/orte/contrib/shape_android/res/drawable-hdpi/ic_action_cast.png and /dev/null differ diff --git a/orte/contrib/shape_android/res/drawable-hdpi/ic_action_download.png b/orte/contrib/shape_android/res/drawable-hdpi/ic_action_download.png deleted file mode 100644 index 9fc6455..0000000 Binary files a/orte/contrib/shape_android/res/drawable-hdpi/ic_action_download.png and /dev/null differ diff --git a/orte/contrib/shape_android/res/drawable-hdpi/ic_action_refresh.png b/orte/contrib/shape_android/res/drawable-hdpi/ic_action_refresh.png new file mode 100644 index 0000000..dae2790 Binary files /dev/null and b/orte/contrib/shape_android/res/drawable-hdpi/ic_action_refresh.png differ diff --git a/orte/contrib/shape_android/res/drawable-mdpi/ic_action_cast.png b/orte/contrib/shape_android/res/drawable-mdpi/ic_action_cast.png deleted file mode 100644 index 49e214b..0000000 Binary files a/orte/contrib/shape_android/res/drawable-mdpi/ic_action_cast.png and /dev/null differ diff --git a/orte/contrib/shape_android/res/drawable-mdpi/ic_action_download.png b/orte/contrib/shape_android/res/drawable-mdpi/ic_action_download.png deleted file mode 100644 index 84b43d3..0000000 Binary files a/orte/contrib/shape_android/res/drawable-mdpi/ic_action_download.png and /dev/null differ diff --git a/orte/contrib/shape_android/res/drawable-mdpi/ic_action_refresh.png b/orte/contrib/shape_android/res/drawable-mdpi/ic_action_refresh.png new file mode 100644 index 0000000..94ab6f4 Binary files /dev/null and b/orte/contrib/shape_android/res/drawable-mdpi/ic_action_refresh.png differ diff --git a/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_cast.png b/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_cast.png deleted file mode 100644 index 7c4d657..0000000 Binary files a/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_cast.png and /dev/null differ diff --git a/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_download.png b/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_download.png deleted file mode 100644 index 702ad47..0000000 Binary files a/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_download.png and /dev/null differ diff --git a/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_refresh.png b/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_refresh.png new file mode 100644 index 0000000..ab4ab9d Binary files /dev/null and b/orte/contrib/shape_android/res/drawable-xhdpi/ic_action_refresh.png differ diff --git a/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_cast.png b/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_cast.png deleted file mode 100644 index f394a34..0000000 Binary files a/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_cast.png and /dev/null differ diff --git a/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_download.png b/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_download.png deleted file mode 100644 index 6bcd831..0000000 Binary files a/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_download.png and /dev/null differ diff --git a/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_refresh.png b/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_refresh.png new file mode 100644 index 0000000..44ee117 Binary files /dev/null and b/orte/contrib/shape_android/res/drawable-xxhdpi/ic_action_refresh.png differ diff --git a/orte/contrib/shape_android/res/layout/activity_help.xml b/orte/contrib/shape_android/res/layout/activity_help.xml new file mode 100644 index 0000000..28d11a2 --- /dev/null +++ b/orte/contrib/shape_android/res/layout/activity_help.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/orte/contrib/shape_android/res/layout/activity_main.xml b/orte/contrib/shape_android/res/layout/activity_main.xml deleted file mode 100644 index 57bafec..0000000 --- a/orte/contrib/shape_android/res/layout/activity_main.xml +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/orte/contrib/shape_android/res/layout/activity_publisher.xml b/orte/contrib/shape_android/res/layout/activity_publisher.xml new file mode 100644 index 0000000..df7af63 --- /dev/null +++ b/orte/contrib/shape_android/res/layout/activity_publisher.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/orte/contrib/shape_android/res/layout/activity_settings.xml b/orte/contrib/shape_android/res/layout/activity_settings.xml new file mode 100644 index 0000000..e367bb3 --- /dev/null +++ b/orte/contrib/shape_android/res/layout/activity_settings.xml @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/orte/contrib/shape_android/res/layout/fragment_main.xml b/orte/contrib/shape_android/res/layout/fragment_main.xml deleted file mode 100644 index fcb917b..0000000 --- a/orte/contrib/shape_android/res/layout/fragment_main.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/orte/contrib/shape_android/res/layout/fragment_publisher.xml b/orte/contrib/shape_android/res/layout/fragment_publisher.xml deleted file mode 100644 index 83d4697..0000000 --- a/orte/contrib/shape_android/res/layout/fragment_publisher.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/orte/contrib/shape_android/res/layout/fragment_subscriber.xml b/orte/contrib/shape_android/res/layout/fragment_subscriber.xml deleted file mode 100644 index eff30d5..0000000 --- a/orte/contrib/shape_android/res/layout/fragment_subscriber.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/orte/contrib/shape_android/res/menu/help.xml b/orte/contrib/shape_android/res/menu/help.xml new file mode 100644 index 0000000..30e85b8 --- /dev/null +++ b/orte/contrib/shape_android/res/menu/help.xml @@ -0,0 +1,5 @@ + + + diff --git a/orte/contrib/shape_android/res/menu/main.xml b/orte/contrib/shape_android/res/menu/main.xml deleted file mode 100644 index 3671a87..0000000 --- a/orte/contrib/shape_android/res/menu/main.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - diff --git a/orte/contrib/shape_android/res/menu/publisher.xml b/orte/contrib/shape_android/res/menu/publisher.xml index 090b25d..33cad24 100644 --- a/orte/contrib/shape_android/res/menu/publisher.xml +++ b/orte/contrib/shape_android/res/menu/publisher.xml @@ -1,14 +1,30 @@ + tools:context="org.ocera.orte.shape_android.PublisherActivity" > + + + android:icon="@drawable/ic_action_new" /> + + diff --git a/orte/contrib/shape_android/res/menu/subscriber.xml b/orte/contrib/shape_android/res/menu/subscriber.xml index 1e0a5b0..3bcc931 100644 --- a/orte/contrib/shape_android/res/menu/subscriber.xml +++ b/orte/contrib/shape_android/res/menu/subscriber.xml @@ -1,27 +1,43 @@ - + tools:context="org.ocera.orte.shape_android.SubscriberActivity" > + + + android:showAsAction="never" /> + android:showAsAction="never" /> + android:showAsAction="never" /> + android:showAsAction="never" /> + android:showAsAction="never" /> + + + diff --git a/orte/contrib/shape_android/res/values-cs/strings.xml b/orte/contrib/shape_android/res/values-cs/strings.xml new file mode 100644 index 0000000..0fa5e2f --- /dev/null +++ b/orte/contrib/shape_android/res/values-cs/strings.xml @@ -0,0 +1,54 @@ + + + + ORTE demo aplikace + + Subscribers + Publishers + Nápověda + Nastavení + + Přepni + Nový + Nastavení + Nápověda + + Modrá + Zelená + Červená + Černá + Žlutá + + OK + ZruÅ¡it + Smazat + Přidat + Barva pro nový Publisher? + Publisher # + + O projektu ORTE + Open Real-Time Ethernet (ORTE) je open source implementace Real-Time Publish-Subscribe (RTPS) komunikačního protokolu. RTPS je nový protokol aplikační vrstvy cílící na oblast real-time komunikace, postavené na UDP protokolu. Protože existuje mnoho implementací TCP/IP v mnoha operačních systémech a RTPS protokol nemá žádné speciální HW/SW nároky, měl by být lehce portovatelný na mnoho cílových HW/SW platforem. Protože používá pouze UDP protokol, zachovává řízení časování a spolehlivosti. [zdroj] + O programu Shape + Shape je zkuÅ¡ební aplikace dodávaná se zdrojovým kódem ORTE. + + Ikony + Přepne z Publisherů na Subscribery a zpátky. + Vytvoří nový Publisher. + + Základní menu + Nastavení - nastavení parametrů jako IP adresy Managerů, scaling, … + Nápověda - zobrazí tuto nápovědu. + + Publisher menu + #n Color Shape (např. #1 Red Circle) je označení Publisherů. #n je sekvenční číslo následované barvou a tvarem. Po kliknutí se objeví menu, kde se nastavuje síla (strength) Publishera. Pokud je přidáno dva a více Publisherů stejné barvy, je Subscribery preferován ten s největší silou. + + Subscriber menu + Modrá, Zelená, Červená, Černá, Žlutá - ve výchozím nastavení je nastavené odebírání každé barvy. Nicméně odebírání určité barvy může být vymazáno (a znovu přidáno) a může být nastaven čas pro minimální zpoždění aktualizací Publisherů. + + Scaling + Povolí normování velikosti mezi implementací programu Shape pro Android a základní verzí. + Managers + IP adresy Managerů oddělené čárkou (,) + + + diff --git a/orte/contrib/shape_android/res/values-v11/styles.xml b/orte/contrib/shape_android/res/values-v11/styles.xml index a4a95bc..3c02242 100644 --- a/orte/contrib/shape_android/res/values-v11/styles.xml +++ b/orte/contrib/shape_android/res/values-v11/styles.xml @@ -4,7 +4,7 @@ Base application theme for API 11+. This theme completely replaces AppBaseTheme from res/values/styles.xml on API 11+ devices. --> - diff --git a/orte/contrib/shape_android/res/values-v14/styles.xml b/orte/contrib/shape_android/res/values-v14/styles.xml index 664f4f1..a91fd03 100644 --- a/orte/contrib/shape_android/res/values-v14/styles.xml +++ b/orte/contrib/shape_android/res/values-v14/styles.xml @@ -5,7 +5,7 @@ AppBaseTheme from BOTH res/values/styles.xml and res/values-v11/styles.xml on API 14+ devices. --> - diff --git a/orte/contrib/shape_android/res/values/strings.xml b/orte/contrib/shape_android/res/values/strings.xml index 3a3b40b..1fc4ef7 100644 --- a/orte/contrib/shape_android/res/values/strings.xml +++ b/orte/contrib/shape_android/res/values/strings.xml @@ -1,20 +1,54 @@ - shape4a - OK - Cancel - Color for new Publisher? - Publisher # - Delete - Add + ORTE demo application + + Subscribers + Publishers + Help + Settings + + Switch + New Settings Help + Blue Green Red Black Yellow - New + + OK + Cancel + Delete + Add + Color for new Publisher? + Publisher # + + About ORTE + The Open Real-Time Ethernet (ORTE) is an open source implementation of Real-Time Publish-Subscribe (RTPS) communication protocol. RTPS is new application layer protocol targeted to real-time communication area, which is build on the top of standard UDP stack. Since there are many TCP/IP stack implementations under many operating systems and RTPS protocol does not have any other special HW/SW requirements, it should be easily ported to many HW/SW target platforms. Because it uses only UDP protocol, it retains control of timing and reliability. [source] + About Shape + Shape is demo application delivered with ORTE source code. + + Icons + Goes from Publishers to Subscribers and back. + Create new Publisher. + + Generic menu + Settings - set up parameters like IP addresses of Managers, scaling, … + Help - shows this help. + + Publisher menu + #n Color Shape (i.e. #1 Red Circle) is how Publishers are denoted. #n is sequence number followed by color and shape. When Publisher is clicked, settings menu appear, where strength of Publisher may be changed. If two and more Publishers of same color are added, the one with the greatest strength is preferred by Subscribers. + + Subscriber menu + Blue, Green, Red, Black, Yellow - subscribing to each color is set to enabled by default. However, the subscription may be deleted (and added again) for certain color and minimum separation time may be set. + + Scaling + Allow scaling for shapes + Managers + Comma separated Manager\'s IP addresses + diff --git a/orte/contrib/shape_android/res/values/styles.xml b/orte/contrib/shape_android/res/values/styles.xml index 845fb57..6ce89c7 100644 --- a/orte/contrib/shape_android/res/values/styles.xml +++ b/orte/contrib/shape_android/res/values/styles.xml @@ -4,7 +4,7 @@ Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. --> -