├── .gitignore ├── contrib ├── GreenDroid └── GreenDroid-GoogleAPIs ├── res ├── drawable-mdpi │ ├── icon.png │ ├── rss.png │ ├── icon_ad.png │ ├── twitter.png │ ├── youtube.png │ ├── facebook.png │ ├── foursquare.png │ ├── icon_home.png │ ├── icon_logo.png │ ├── dashboard_button_default.png │ └── dashboard_button_focused.png ├── values │ ├── theme.xml │ ├── dimen.xml │ ├── style.xml │ └── strings.xml ├── color │ └── map_pin.xml ├── layout │ ├── ad_layout.xml │ ├── about.xml │ ├── riders_view.xml │ ├── mapscreen.xml │ └── dashboard.xml ├── xml │ ├── settings.xml │ ├── news_items.xml │ ├── partners_items.xml │ ├── events_items.xml │ └── schedule_items.xml └── drawable │ └── dashboard_button.xml ├── libs └── GoogleAdMobAdsSdk-4.1.0.jar ├── src └── com │ └── fssle │ └── adpad │ ├── AdPadApplication.java │ ├── ScheduleActivity.java │ ├── PartnersActivity.java │ ├── EventsActivity.java │ ├── NewsActivity.java │ ├── BrowserActivity.java │ ├── ShareActivity.java │ ├── SocialActivity.java │ ├── MyLog.java │ ├── SettingsActivity.java │ ├── AdsUtils.java │ ├── AdvertisingAdapter.java │ ├── RidersActivity.java │ ├── MapScreenActivity.java │ ├── AdPadActivity.java │ └── DashboardLayout.java ├── local.properties ├── default.properties ├── proguard.cfg ├── AndroidManifest.xml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | gen/ 3 | key/ -------------------------------------------------------------------------------- /contrib/GreenDroid: -------------------------------------------------------------------------------- 1 | /Users/dli/code/android/GreenDroid/GreenDroid -------------------------------------------------------------------------------- /contrib/GreenDroid-GoogleAPIs: -------------------------------------------------------------------------------- 1 | /Users/dli/code/android/GreenDroid/GreenDroid-GoogleAPIs -------------------------------------------------------------------------------- /res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/ad-pad/master/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /res/drawable-mdpi/rss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/ad-pad/master/res/drawable-mdpi/rss.png -------------------------------------------------------------------------------- /res/drawable-mdpi/icon_ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/ad-pad/master/res/drawable-mdpi/icon_ad.png -------------------------------------------------------------------------------- /res/drawable-mdpi/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/ad-pad/master/res/drawable-mdpi/twitter.png -------------------------------------------------------------------------------- /res/drawable-mdpi/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/ad-pad/master/res/drawable-mdpi/youtube.png -------------------------------------------------------------------------------- /libs/GoogleAdMobAdsSdk-4.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/ad-pad/master/libs/GoogleAdMobAdsSdk-4.1.0.jar -------------------------------------------------------------------------------- /res/drawable-mdpi/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/ad-pad/master/res/drawable-mdpi/facebook.png -------------------------------------------------------------------------------- /res/drawable-mdpi/foursquare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/ad-pad/master/res/drawable-mdpi/foursquare.png -------------------------------------------------------------------------------- /res/drawable-mdpi/icon_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/ad-pad/master/res/drawable-mdpi/icon_home.png -------------------------------------------------------------------------------- /res/drawable-mdpi/icon_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/ad-pad/master/res/drawable-mdpi/icon_logo.png -------------------------------------------------------------------------------- /res/drawable-mdpi/dashboard_button_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/ad-pad/master/res/drawable-mdpi/dashboard_button_default.png -------------------------------------------------------------------------------- /res/drawable-mdpi/dashboard_button_focused.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite/ad-pad/master/res/drawable-mdpi/dashboard_button_focused.png -------------------------------------------------------------------------------- /res/values/theme.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /res/values/dimen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 50dp 4 | 5dp 5 | 6 | -------------------------------------------------------------------------------- /src/com/fssle/adpad/AdPadApplication.java: -------------------------------------------------------------------------------- 1 | package com.fssle.adpad; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import greendroid.app.GDApplication; 6 | 7 | public class AdPadApplication extends GDApplication { 8 | 9 | @Override 10 | public Class getHomeActivityClass() { 11 | return AdPadActivity.class; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /res/color/map_pin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /local.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must *NOT* be checked in Version Control Systems, 5 | # as it contains information specific to your local configuration. 6 | 7 | # location of the SDK. This is only used by Ant 8 | # For customization when using a Version Control System, please read the 9 | # header note. 10 | sdk.dir=/Users/dli/tools/android-sdk/android-sdk-mac_x86 11 | -------------------------------------------------------------------------------- /default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=Google Inc.:Google APIs:4 12 | android.library.reference.1=./contrib/GreenDroid-GoogleAPIs -------------------------------------------------------------------------------- /res/layout/ad_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 15 | -------------------------------------------------------------------------------- /res/xml/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 10 | -------------------------------------------------------------------------------- /res/drawable/dashboard_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 11 | 14 | -------------------------------------------------------------------------------- /res/values/style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | -------------------------------------------------------------------------------- /src/com/fssle/adpad/ScheduleActivity.java: -------------------------------------------------------------------------------- 1 | package com.fssle.adpad; 2 | 3 | import android.os.Bundle; 4 | 5 | import greendroid.app.GDListActivity; 6 | import greendroid.widget.ItemAdapter; 7 | 8 | public class ScheduleActivity extends GDListActivity 9 | { 10 | /** Called when the activity is first created. */ 11 | @Override 12 | public void onCreate(Bundle savedInstanceState) 13 | { 14 | super.onCreate(savedInstanceState); 15 | // setContentView(R.layout.main); 16 | 17 | ItemAdapter adapter; 18 | try { 19 | adapter = ItemAdapter.createFromXml(this, R.xml.schedule_items); 20 | setListAdapter(adapter); 21 | } catch (Exception e) { 22 | e.printStackTrace(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/com/fssle/adpad/PartnersActivity.java: -------------------------------------------------------------------------------- 1 | package com.fssle.adpad; 2 | 3 | import android.os.Bundle; 4 | 5 | import greendroid.app.GDListActivity; 6 | import greendroid.widget.ItemAdapter; 7 | 8 | public class PartnersActivity extends GDListActivity 9 | { 10 | /** Called when the activity is first created. */ 11 | @Override 12 | public void onCreate(Bundle savedInstanceState) 13 | { 14 | super.onCreate(savedInstanceState); 15 | // setContentView(R.layout.main); 16 | 17 | ItemAdapter adapter; 18 | try { 19 | adapter = ItemAdapter.createFromXml(this, R.xml.partners_items); 20 | setListAdapter(adapter); 21 | } catch (Exception e) { 22 | e.printStackTrace(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /res/layout/about.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 12 | 13 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/com/fssle/adpad/EventsActivity.java: -------------------------------------------------------------------------------- 1 | package com.fssle.adpad; 2 | 3 | import android.os.Bundle; 4 | 5 | import greendroid.app.GDListActivity; 6 | // import greendroid.app.GDExpandableListActivity; 7 | import greendroid.widget.ItemAdapter; 8 | 9 | public class EventsActivity extends GDListActivity 10 | { 11 | /** Called when the activity is first created. */ 12 | @Override 13 | public void onCreate(Bundle savedInstanceState) 14 | { 15 | super.onCreate(savedInstanceState); 16 | // setContentView(R.layout.main); 17 | 18 | ItemAdapter adapter; 19 | try { 20 | adapter = ItemAdapter.createFromXml(this, R.xml.events_items); 21 | setListAdapter(adapter); 22 | } catch (Exception e) { 23 | e.printStackTrace(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/com/fssle/adpad/NewsActivity.java: -------------------------------------------------------------------------------- 1 | package com.fssle.adpad; 2 | 3 | import android.os.Bundle; 4 | 5 | import greendroid.app.GDListActivity; 6 | import greendroid.widget.ItemAdapter; 7 | 8 | public class NewsActivity extends GDListActivity 9 | { 10 | /** Called when the activity is first created. */ 11 | @Override 12 | public void onCreate(Bundle savedInstanceState) 13 | { 14 | super.onCreate(savedInstanceState); 15 | // setContentView(R.layout.main); 16 | // setActionBarContentView(R.layout.main); 17 | 18 | ItemAdapter adapter; 19 | try { 20 | adapter = ItemAdapter.createFromXml(this, R.xml.news_items); 21 | setListAdapter(adapter); 22 | AdvertisingAdapter ad = new AdvertisingAdapter(this, adapter); 23 | } catch (Exception e) { 24 | e.printStackTrace(); 25 | } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /res/layout/riders_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | 23 | 24 | -------------------------------------------------------------------------------- /res/xml/news_items.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | 12 | 15 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /res/layout/mapscreen.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 17 | 18 | 23 | 28 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/com/fssle/adpad/BrowserActivity.java: -------------------------------------------------------------------------------- 1 | package com.fssle.adpad; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.text.TextUtils; 6 | import android.webkit.WebView; 7 | import android.webkit.WebViewClient; 8 | 9 | // import greendroid.app.GDActivity; 10 | 11 | public class BrowserActivity extends Activity { 12 | 13 | public static final String URL = "com.fssle.adpad.URL"; 14 | private WebView browser; 15 | 16 | @Override 17 | public void onCreate(Bundle icicle) { 18 | super.onCreate(icicle); 19 | 20 | browser=new WebView(this); 21 | setContentView(browser); 22 | browser.getSettings().setJavaScriptEnabled(true); 23 | browser.setWebViewClient(new WebViewClient() { 24 | @Override 25 | public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) 26 | { 27 | // Handle the error 28 | } 29 | 30 | @Override 31 | public boolean shouldOverrideUrlLoading(WebView view, String url) 32 | { 33 | view.loadUrl(url); 34 | return true; 35 | } 36 | }); 37 | browser.loadUrl(getIntent().getStringExtra(URL)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class * extends android.app.backup.BackupAgentHelper 14 | -keep public class * extends android.preference.Preference 15 | -keep public class com.android.vending.licensing.ILicensingService 16 | 17 | -keepclasseswithmembernames class * { 18 | native ; 19 | } 20 | 21 | -keepclasseswithmembernames class * { 22 | public (android.content.Context, android.util.AttributeSet); 23 | } 24 | 25 | -keepclasseswithmembernames class * { 26 | public (android.content.Context, android.util.AttributeSet, int); 27 | } 28 | 29 | -keepclassmembers enum * { 30 | public static **[] values(); 31 | public static ** valueOf(java.lang.String); 32 | } 33 | 34 | -keep class * implements android.os.Parcelable { 35 | public static final android.os.Parcelable$Creator *; 36 | } 37 | -------------------------------------------------------------------------------- /res/xml/partners_items.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 14 | 19 | 24 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AdPad 4 | 5 | News 6 | Map Screen 7 | Events 8 | Schedule 9 | Riders 10 | Partners 11 | Photos/videos 12 | Social 13 | 14 | Share 15 | Uploads 16 | 17 | Feed 18 | Facebook 19 | Twitter 20 | Youtube 21 | Foursquare 22 | 23 | Credits 24 | Show Ads 25 | Show/Hide Ads informations. 26 | About 27 | More informations. 28 | Version %1$s (r%2$s) 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/com/fssle/adpad/ShareActivity.java: -------------------------------------------------------------------------------- 1 | package com.fssle.adpad; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.widget.TabHost; 8 | 9 | import greendroid.app.GDTabActivity; 10 | 11 | public class ShareActivity extends GDTabActivity{ 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | // setContentView (R.layout.web_view); 17 | // setActionBarContentView(R.layout.web_view); 18 | Intent i=new Intent(this, BrowserActivity.class); 19 | 20 | TabHost host=getTabHost(); 21 | 22 | final String shareText = getString(R.string.share_label); 23 | // i.putExtra(BrowserActivity.URL, "http://www.flickr.com/photos/tags/blue/"); 24 | i.putExtra(BrowserActivity.URL, "http://www.google.com.hk/imgcat?hl=zh-CN&catid=564&sa=h"); 25 | // addTab(shareText, shareText, i); 26 | host.addTab(host.newTabSpec(shareText).setIndicator(shareText).setContent(i)); 27 | 28 | final String uploadsText = getString(R.string.uploads_label); 29 | // i.putExtra(BrowserActivity.URL, "http://www.android.com"); 30 | i.putExtra(BrowserActivity.URL, "http://www.google.com.hk/imgcat?hl=zh-CN&catid=603&sa=h"); 31 | // addTab(uploadsText, uploadsText, i); 32 | host.addTab(host.newTabSpec(uploadsText).setIndicator(uploadsText).setContent(i)); 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /res/xml/events_items.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | 12 | 15 | 18 | 21 | 24 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /res/xml/schedule_items.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | 12 | 15 | 18 | 21 | 24 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/com/fssle/adpad/SocialActivity.java: -------------------------------------------------------------------------------- 1 | package com.fssle.adpad; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.widget.TabHost; 8 | 9 | import greendroid.app.GDTabActivity; 10 | 11 | public class SocialActivity extends GDTabActivity { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | 17 | Intent i=new Intent(this, BrowserActivity.class); 18 | 19 | TabHost host=getTabHost(); 20 | 21 | final String feedText = getString(R.string.feed_label); 22 | i.putExtra(BrowserActivity.URL, "http://www.google.com"); 23 | // addTab(feedText, feedText, i); 24 | host.addTab(host.newTabSpec(feedText).setIndicator(feedText).setContent(i)); 25 | 26 | 27 | final String facebookText = getString(R.string.facebook_label); 28 | i.putExtra(BrowserActivity.URL, "http://www.facebook.com"); 29 | // addTab(facebookText, facebookText, i); 30 | host.addTab(host.newTabSpec(facebookText).setIndicator(facebookText).setContent(i)); 31 | 32 | final String twitterText = getString(R.string.twitter_label); 33 | i.putExtra(BrowserActivity.URL, "http://www.twitter.com"); 34 | // addTab(twitterText, twitterText, i); 35 | host.addTab(host.newTabSpec(twitterText).setIndicator(twitterText).setContent(i)); 36 | 37 | final String youtubeText = getString(R.string.youtube_label); 38 | i.putExtra(BrowserActivity.URL, "http://www.youtube.com"); 39 | // addTab(youtubeText, youtubeText, i); 40 | host.addTab(host.newTabSpec(youtubeText).setIndicator(youtubeText).setContent(i)); 41 | 42 | final String foursquareText = getString(R.string.foursquare_label); 43 | i.putExtra(BrowserActivity.URL, "http://www.foursquare.com"); 44 | // addTab(foursquareText, foursquareText, i); 45 | host.addTab(host.newTabSpec(foursquareText).setIndicator(foursquareText).setContent(i)); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/com/fssle/adpad/MyLog.java: -------------------------------------------------------------------------------- 1 | package com.fssle.adpad; 2 | 3 | import android.util.Log; 4 | 5 | public class MyLog { 6 | 7 | public static final String MAIN_TAG = "MonTransit"; 8 | 9 | private static boolean DEBUG = false; 10 | public static final boolean SHOW_LOCATION = false; 11 | 12 | public static boolean isLoggable(int level) { 13 | return DEBUG || Log.isLoggable(MAIN_TAG, level); 14 | } 15 | 16 | public static void v(String tag, String msg) { 17 | if (DEBUG || Log.isLoggable(MAIN_TAG, Log.VERBOSE)) { 18 | Log.v(MAIN_TAG, String.format("%s>%s", tag, msg)); 19 | } 20 | } 21 | 22 | public static void v(String tag, String msg, Object... args) { 23 | if (DEBUG || Log.isLoggable(MAIN_TAG, Log.VERBOSE)) { 24 | Log.v(MAIN_TAG, String.format("%s>%s", tag, String.format(msg, args))); 25 | } 26 | } 27 | 28 | public static void d(String tag, String msg) { 29 | if (DEBUG || Log.isLoggable(MAIN_TAG, Log.DEBUG)) { 30 | Log.d(MAIN_TAG, String.format("%s>%s", tag, msg)); 31 | } 32 | } 33 | 34 | public static void d(String tag, String msg, Object... args) { 35 | if (DEBUG || Log.isLoggable(MAIN_TAG, Log.DEBUG)) { 36 | Log.d(MAIN_TAG, String.format("%s>%s", tag, String.format(msg, args))); 37 | } 38 | } 39 | 40 | public static void i(String tag, String msg) { 41 | if (DEBUG || Log.isLoggable(MAIN_TAG, Log.INFO)) { 42 | Log.i(MAIN_TAG, String.format("%s>%s", tag, msg)); 43 | } 44 | } 45 | 46 | public static void i(String tag, String msg, Object... args) { 47 | if (DEBUG || Log.isLoggable(MAIN_TAG, Log.INFO)) { 48 | Log.i(MAIN_TAG, String.format("%s>%s", tag, String.format(msg, args))); 49 | } 50 | } 51 | 52 | public static void w(String tag, String msg, Object... args) { 53 | if (DEBUG || Log.isLoggable(MAIN_TAG, Log.WARN)) { 54 | Log.w(MAIN_TAG, String.format("%s>%s", tag, String.format(msg, args))); 55 | } 56 | } 57 | 58 | public static void w(String tag, Throwable t, String msg, Object... args) { 59 | if (DEBUG || Log.isLoggable(MAIN_TAG, Log.WARN)) { 60 | Log.w(MAIN_TAG, String.format("%s>%s", tag, String.format(msg, args)), t); 61 | } 62 | } 63 | 64 | public static void e(String tag, Throwable t, String msg) { 65 | if (DEBUG || Log.isLoggable(MAIN_TAG, Log.ERROR)) { 66 | Log.e(MAIN_TAG, String.format("%s>%s", tag, msg), t); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /res/layout/dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 |