<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
-
+
<!-- TODO: http://developer.android.com/guide/topics/manifest/supports-screens-element.html -->
<!-- TODO: supporting multiple layouts/languages http://developer.android.com/guide/practices/screens_support.html -->
<compatible-screens>
- <screen android:screenSize="normal" android:screenDensity="xhdpi" />
- </compatible-screens>
+ <screen
+ android:screenDensity="xhdpi"
+ android:screenSize="normal" />
+ </compatible-screens>
+
<supports-screens android:smallScreens="false" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
-
- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
-
+ <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:logo="@drawable/ic_launcher"
- android:theme="@style/AppTheme"
- android:supportsRtl="false">
-
- <activity android:name="de.example.exampletdd.WeatherTabsActivity"
+ android:supportsRtl="false"
+ android:theme="@style/AppTheme" >
+ <activity
+ android:name=".WeatherTabsActivity"
android:hardwareAccelerated="false"
- android:uiOptions="splitActionBarWhenNarrow"
- android:launchMode="singleTop" >
+ android:launchMode="singleTop"
+ android:uiOptions="splitActionBarWhenNarrow" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
- <activity android:name="de.example.exampletdd.WeatherInformationPreferencesActivity"
- android:parentActivityName="de.example.exampletdd.WeatherTabsActivity" >
+ <activity
+ android:name=".WeatherInformationPreferencesActivity"
+ android:parentActivityName=".WeatherTabsActivity" >
<intent-filter>
<action android:name="android.intent.action.WEATHERINFORMATIONSETTINGS" />
+
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
- <action android:name="android.intent.action.MANAGE_NETWORK_USAGE" />
- <category android:name="android.intent.category.DEFAULT" />
+ <action android:name="android.intent.action.MANAGE_NETWORK_USAGE" />
+
+ <category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
- <activity android:name="de.example.exampletdd.MapActivity"
- android:parentActivityName="de.example.exampletdd.WeatherTabsActivity" >
+ <activity
+ android:name=".MapActivity"
+ android:parentActivityName=".WeatherTabsActivity" >
<intent-filter>
<action android:name="android.intent.action.WEATHERINFORMATIONMAP" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
- <activity android:name="de.example.exampletdd.SpecificActivity"
- android:parentActivityName="de.example.exampletdd.WeatherTabsActivity"
- android:exported="false" >
+ <activity
+ android:name=".SpecificActivity"
+ android:exported="false"
+ android:parentActivityName=".WeatherTabsActivity" >
<intent-filter>
<action android:name="android.intent.action.WEATHERINFORMATIONSPECIFICDATA" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
- <activity android:name="de.example.exampletdd.widget.WidgetConfigure"
- android:taskAffinity=""
- android:excludeFromRecents="true">
+ <activity
+ android:name=".widget.WidgetConfigure"
+ android:excludeFromRecents="true"
+ android:taskAffinity="" >
+ <intent-filter>
+ <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
+ </intent-filter>
+ </activity>
+ <activity
+ android:name=".AboutActivity"
+ android:label="@string/title_activity_about"
+ android:parentActivityName=".WeatherTabsActivity" >
<intent-filter>
- <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
+ <action android:name="android.intent.action.WEATHERINFORMATIONABOUT" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
-
- <receiver android:name="de.example.exampletdd.WeatherInformationBootReceiver"
- android:enabled="true">
+
+ <receiver
+ android:name=".WeatherInformationBootReceiver"
+ android:enabled="true" >
<intent-filter>
- <action android:name="android.intent.action.BOOT_COMPLETED"></action>
+ <action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
- <receiver android:name="de.example.exampletdd.widget.WidgetProvider" >
+ <receiver android:name=".widget.WidgetProvider" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
- <meta-data android:name="android.appwidget.provider"
- android:resource="@xml/appwidget_provider" />
+
+ <meta-data
+ android:name="android.appwidget.provider"
+ android:resource="@xml/appwidget_provider" />
</receiver>
<!-- Service to update Notification -->
- <service android:name="de.example.exampletdd.NotificationIntentService"
- android:exported="false"
- android:enabled="true" />
-
+ <service
+ android:name=".NotificationIntentService"
+ android:enabled="true"
+ android:exported="false" />
+
<!-- Service to update Widget -->
- <service android:name="de.example.exampletdd.WidgetIntentService"
- android:exported="false"
- android:enabled="true" />
-
+ <service
+ android:name=".WidgetIntentService"
+ android:enabled="true"
+ android:exported="false" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
--- /dev/null
+package de.example.exampletdd;
+
+import android.app.ActionBar;
+import android.app.Activity;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.view.View;
+
+
+public class AboutActivity extends Activity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.weather_about);
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+
+ final ActionBar actionBar = this.getActionBar();
+ actionBar.setTitle(this.getString(R.string.weather_about_action));
+ }
+
+ public void onClickLegalInformation(final View view) {
+
+ }
+
+ public void onClickSourceCode(final View view) {
+ final String url = this.getString(R.string.application_source_code_url);
+ startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+ }
+
+ public void onClickRemoteData(final View view) {
+ final String url = this.getString(R.string.openweahtermap_url);
+ startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+ }
+
+ public void onClickMyWeb(final View view) {
+ final String url = this.getString(R.string.my_url);
+ startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+ }
+}
"de.example.exampletdd.MapActivity"));
this.startActivity(intent);
return true;
+ } else if (itemId == R.id.weather_menu_about) {
+ intent = new Intent("de.example.exampletdd.WEATHERINFO").
+ setComponent(new ComponentName("de.example.exampletdd",
+ "de.example.exampletdd.AboutActivity"));
+ this.startActivity(intent);
+ return true;
} else {
}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:contentDescription="@string/icon_weather_description"
+ android:orientation="horizontal"
+ android:src="@drawable/ic_launcher" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/weather_about_application"
+ android:textColor="?android:attr/colorForeground"
+ android:padding="5dp"
+ android:layout_gravity="start" />
+ <View style="@style/Divider"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/weather_about_application_version"
+ android:padding="20dp"
+ android:layout_gravity="start" />
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/weather_about_application_legal"
+ android:padding="20dp"
+ android:layout_gravity="start"
+ android:clickable="true"
+ android:onClick="onClickLegalInformation"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/weather_about_application_source_code"
+ android:padding="20dp"
+ android:layout_gravity="start"
+ android:clickable="true"
+ android:onClick="onClickSourceCode"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/weather_about_application_remote_data"
+ android:textColor="?android:attr/colorForeground"
+ android:padding="5dp"
+ android:layout_gravity="start" />
+ <View style="@style/Divider"/>
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/weather_about_application_remote_data_openweathermap"
+ android:padding="20dp"
+ android:layout_gravity="start"
+ android:clickable="true"
+ android:onClick="onClickRemoteData"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/weather_about_application_developer"
+ android:textColor="?android:attr/colorForeground"
+ android:padding="5dp"
+ android:layout_gravity="start" />
+ <View style="@style/Divider"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/weather_about_application_developer_name"
+ android:padding="20dp"
+ android:layout_gravity="start" />
+
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/weather_about_application_developer_web"
+ android:padding="20dp"
+ android:layout_gravity="start"
+ android:clickable="true"
+ android:onClick="onClickMyWeb"/>
+ </LinearLayout>
+</ScrollView>
\ No newline at end of file
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
- <item
- android:id="@+id/weather_menu_settings"
+ <item android:id="@+id/weather_menu_settings"
android:menuCategory="system"
android:title="@string/weather_preferences_action_settings"
android:titleCondensed="@string/weather_preferences_action_settings"
android:icon="@drawable/ic_action_settings"
android:showAsAction="ifRoom">
</item>
- <item
- android:id="@+id/weather_menu_map"
+ <item android:id="@+id/weather_menu_map"
android:icon="@drawable/ic_action_map"
android:showAsAction="ifRoom"
android:visible="true"
android:title="@string/weather_map_action_map"
android:titleCondensed="@string/weather_map_action_map">
</item>
-
+ <item android:id="@+id/weather_menu_about"
+ android:showAsAction="never"
+ android:visible="true"
+ android:checkable="false"
+ android:enabled="true"
+ android:checked="false"
+ android:orderInCategory="100"
+ android:title="@string/weather_about_action"
+ android:titleCondensed="@string/weather_about_action">
+ </item>
</menu>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<string name="app_name">Weather Information</string>
- <string name="icon_weather_description">Icon weather</string>
-
+ <string name="icon_weather_description">Icon weather</string>
<!-- Activities Current, Overview and Specific -->
<string name="text_field_sun_rise">SUN RISE</string>
<string name="text_units_percent">%</string>
<string name="text_field_remote_error">No data available</string>
-
<!-- Preferences Acitivity -->
<string name="weather_preferences_action_settings">Settings</string>
<string name="weather_preferences_units">Units</string>
<string name="weather_preferences_pressure_human_value_pascal">pascal</string>
<string name="weather_preferences_pressure_human_value_standard_atm">standard atmosphere</string>
-
-
<!-- Widget Preferences Activity -->
<string name="widget_preferences_action_settings">Settings</string>
<string name="widget_preferences_button_refresh">Refresh</string>
<string name="widget_preferences_country_switch_off">OFF</string>
<string name="widget_preferences_country_switch_on">ON</string>
-
<!-- Map Activity -->
<string name="weather_map_action_map">Select Location</string>
<string name="city_not_found">city not found</string>
<string name="country_not_found">country not found</string>
- <string name="progress_dialog_generic_message">Please wait…</string>
+ <string name="progress_dialog_generic_message">Please wait…</string>
<string name="weather_map_button_savelocation">Save Location</string>
- <string name="weather_map_button_getlocation">Get Location</string>
-
-
- <!-- DO NOT TRANSLATE -->
- <string name="uri_api_weather_today">http://api.openweathermap.org/data/{0}/weather?lat={1}&lon={2}&cnt=1</string>
+ <string name="weather_map_button_getlocation">Get Location</string>
+
+ <!-- About Activity -->
+ <string name="weather_about_action">About</string>
+ <string name="weather_about_application">APPLICATION</string>
+ <string name="weather_about_application_version">Version 1.0</string>
+ <string name="weather_about_application_legal">Legal information</string>
+ <string name="weather_about_application_source_code">Source code</string>
+ <string name="weather_about_application_remote_data">REMOTE DATA</string>
+ <string name="weather_about_application_remote_data_openweathermap">OpenWeatherMap</string>
+ <string name="weather_about_application_developer">DEVELOPER</string>
+ <string name="weather_about_application_developer_name">Gustavo Martin Morcuende</string>
+ <string name="weather_about_application_developer_web">Web</string>
+
+ <!-- DO NOT TRANSLATE -->
+ <string name="uri_api_weather_today">http://api.openweathermap.org/data/{0}/weather?lat={1}&lon={2}&cnt=1</string>
<string name="uri_api_weather_forecast">http://api.openweathermap.org/data/{0}/forecast/daily?lat={1}&lon={2}&cnt={3}&mode=json</string>
<string name="api_version">2.5</string>
+ <string name="application_source_code_url">https://github.com/gumartinm/JavaForFun/tree/master/Android/WeatherInformation</string>
+ <string name="my_url">http://gumartinm.name</string>
+ <string name="openweahtermap_url">http://openweathermap.org/</string>
+ <string name="title_activity_about">About</string>
+ <string name="hello_world">Hello world!</string>
+ <string name="action_settings">Settings</string>
+
</resources>
</style>
<color name="weather_time_of_day_color_title">#48aed4</color>
- <color name="widget_background_holo_dark">#ff000000</color>
</resources>