Skip to content

Commit

Permalink
Added admob and adcolony ads
Browse files Browse the repository at this point in the history
  • Loading branch information
spirosbond committed Oct 24, 2013
1 parent f6d2acc commit 4c0d51c
Show file tree
Hide file tree
Showing 22 changed files with 977 additions and 880 deletions.
2 changes: 1 addition & 1 deletion AppSpecificOrientation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ android {
}

dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile 'com.android.support:support-v4:18.0.+'
compile fileTree(dir: 'libs', include: '*.jar')
}
Binary file not shown.
Binary file removed AppSpecificOrientation/libs/StartAppInApp-1.4.3.jar
Binary file not shown.
Binary file added AppSpecificOrientation/libs/adcolony.jar
Binary file not shown.
Binary file removed AppSpecificOrientation/libs/android-support-v4.jar
Binary file not shown.
Binary file not shown.
98 changes: 67 additions & 31 deletions AppSpecificOrientation/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,23 @@
android:value="com.spydiko.rotationmanager.MainActivity"/>
</activity>

<activity android:name="com.startapp.android.publish.list3d.List3DActivity"
android:taskAffinity="com.spydiko.rotationmanager.AppWall"
android:theme="@android:style/Theme" />
<activity android:name="com.startapp.android.publish.AppWallActivity"
android:theme="@android:style/Theme.Translucent" android:taskAffinity="com.spydiko.rotationmanager.AppWall"
android:configChanges="orientation|keyboardHidden" />
<activity
android:name="com.spydiko.rotationmanager.DonateActivity"
android:label="@string/titleDonate"
android:parentActivityName="com.spydiko.rotationmanager.MainActivity">
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.spydiko.rotationmanager.MainActivity"/>

</activity>

<!--<activity android:name="com.startapp.android.publish.list3d.List3DActivity"-->
<!--android:taskAffinity="com.spydiko.rotationmanager.AppWall"-->
<!--android:theme="@android:style/Theme" />-->
<!--<activity android:name="com.startapp.android.publish.AppWallActivity"-->
<!--android:theme="@android:style/Theme.Translucent" android:taskAffinity="com.spydiko.rotationmanager.AppWall"-->
<!--android:configChanges="orientation|keyboardHidden" />-->


<service
Expand All @@ -81,35 +92,60 @@
</receiver>

<activity
android:name="com.appflood.AFPanelActivity"
android:configChanges="keyboardHidden">
</activity>
android:name="com.jirbo.adcolony.AdColonyOverlay"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>

<activity
android:name="com.appflood.AFFullScreenActivity"
android:configChanges="keyboardHidden|orientation"
android:theme="@android:style/Theme.Translucent"
android:launchMode="singleTask">
</activity>
android:name="com.jirbo.adcolony.AdColonyFullscreen"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"/>

<activity
android:name="com.appflood.AFListActivity"
android:configChanges="keyboardHidden|orientation"
android:launchMode="singleTask"
android:theme="@android:style/Theme.Translucent" >
<intent-filter>
<action android:name="" />
</intent-filter>
</activity>
<activity android:name="com.spydiko.rotationmanager.DonateActivity"
android:label="@string/titleDonate" />
android:name="com.jirbo.adcolony.AdColonyBrowser"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"/>

<activity
android:name="com.appflood.AFInterstitialActivity"
android:configChanges="keyboardHidden|orientation"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent" >
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|screenLayout|uiMode|smallestScreenSize|keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">

<meta-data
android:name="ADMOB_PUBLISHER_ID"
android:value="pub-4450409123751393"/>
</activity>
<meta-data android:name="com.startapp.android.DEV_ID" android:value="108632531 "/>
<meta-data android:name="com.startapp.android.APP_ID" android:value="209134043"/>


<!--<activity-->
<!--android:name="com.appflood.AFPanelActivity"-->
<!--android:configChanges="keyboardHidden">-->
<!--</activity>-->
<!--<activity-->
<!--android:name="com.appflood.AFFullScreenActivity"-->
<!--android:configChanges="keyboardHidden|orientation"-->
<!--android:theme="@android:style/Theme.Translucent"-->
<!--android:launchMode="singleTask">-->
<!--</activity>-->
<!--<activity-->
<!--android:name="com.appflood.AFListActivity"-->
<!--android:configChanges="keyboardHidden|orientation"-->
<!--android:launchMode="singleTask"-->
<!--android:theme="@android:style/Theme.Translucent" >-->
<!--<intent-filter>-->
<!--<action android:name="" />-->
<!--</intent-filter>-->
<!--</activity>-->

<!--<activity-->
<!--android:name="com.appflood.AFInterstitialActivity"-->
<!--android:configChanges="keyboardHidden|orientation"-->
<!--android:launchMode="singleTask"-->
<!--android:screenOrientation="portrait"-->
<!--android:theme="@android:style/Theme.Translucent" >-->
<!--</activity>-->
<!--<meta-data android:name="com.startapp.android.DEV_ID" android:value="108632531 "/>-->
<!--<meta-data android:name="com.startapp.android.APP_ID" android:value="209134043"/>-->

</application>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
* Created by PuR3v1L on 27/8/2013.
*/
public class AboutActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) getActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) getActionBar().setDisplayHomeAsUpEnabled(true);
}

public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// Respond to the action bar's Up/Home button
case android.R.id.home:
setResult(RESULT_OK, new Intent());
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// Respond to the action bar's Up/Home button
case android.R.id.home:
setResult(RESULT_OK, new Intent());
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}
Original file line number Diff line number Diff line change
@@ -1,88 +1,101 @@
package com.spydiko.rotationmanager;

import android.app.Activity;
import android.app.Application;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.preference.PreferenceManager;
import android.util.Log;

import com.startapp.android.publish.StartAppAd;
import com.jirbo.adcolony.AdColony;

/**
* Created by PuR3v1L on 7/8/2013.
*/
public class AppSpecificOrientation extends Application {

private static SharedPreferences prefs;
private static SharedPreferences.Editor editor;
private static boolean check_button;


public static boolean isServiceRunning() {
return prefs.getBoolean("service", false);
}

public static void setServiceRunning(boolean serviceRunning) {
editor.putBoolean("service", serviceRunning);
editor.commit();
}

public static boolean getBoot() {
return prefs.getBoolean("boot", false);
}

public static void setBoot(boolean state) {
editor.putBoolean("boot", state);
editor.commit();
}

public static boolean isCheck_button() {
return check_button;
}

public static void setCheck_button(boolean check_button) {
AppSpecificOrientation.check_button = check_button;
}

public boolean loadDonate (String type) {
return prefs.getBoolean(type,false);
}

@Override
public void onCreate() {
super.onCreate();
prefs = PreferenceManager.getDefaultSharedPreferences(this);
editor = prefs.edit();
}

public boolean loadPreferences(String app, Boolean type) {
if (type) {
return prefs.getBoolean(app.concat("portrait"), false);
} else {
return prefs.getBoolean(app.concat("landscape"), false);
}
}

public void savePreferences(String app, Boolean check, Boolean type) {
if (type) {
editor.putBoolean(app.concat("portrait"), check);
} else {
editor.putBoolean(app.concat("landscape"), check);
}
editor.commit();
}

public boolean isCheckedLandscape(String temp) {
return prefs.getBoolean(temp.concat("landscape"), false);
}

public boolean isCheckedPortrait(String temp) {
return prefs.getBoolean(temp.concat("portrait"), false);
}

public void registerShared(DonateActivity donateActivity) {
prefs.registerOnSharedPreferenceChangeListener(donateActivity);
}

public void unregisterShared(DonateActivity donateActivity) {
prefs.unregisterOnSharedPreferenceChangeListener(donateActivity);
}
public static final boolean LOG = true;
private static final String TAG = AppSpecificOrientation.class.getSimpleName();
private static SharedPreferences prefs;
private static SharedPreferences.Editor editor;
private static boolean check_button;


public static boolean isServiceRunning() {
return prefs.getBoolean("service", false);
}

public static void setServiceRunning(boolean serviceRunning) {
editor.putBoolean("service", serviceRunning);
editor.commit();
}

public static boolean getBoot() {
return prefs.getBoolean("boot", false);
}

public static void setBoot(boolean state) {
editor.putBoolean("boot", state);
editor.commit();
}

public static boolean isCheck_button() {
return check_button;
}

public static void setCheck_button(boolean check_button) {
AppSpecificOrientation.check_button = check_button;
}

public boolean loadDonate(String type) {
return prefs.getBoolean(type, false);
}

@Override
public void onCreate() {
super.onCreate();
prefs = PreferenceManager.getDefaultSharedPreferences(this);
editor = prefs.edit();
}

public boolean loadPreferences(String app, Boolean type) {
if (type) {
return prefs.getBoolean(app.concat("portrait"), false);
} else {
return prefs.getBoolean(app.concat("landscape"), false);
}
}

public void savePreferences(String app, Boolean check, Boolean type) {
if (type) {
editor.putBoolean(app.concat("portrait"), check);
} else {
editor.putBoolean(app.concat("landscape"), check);
}
editor.commit();
}

public boolean isCheckedLandscape(String temp) {
return prefs.getBoolean(temp.concat("landscape"), false);
}

public boolean isCheckedPortrait(String temp) {
return prefs.getBoolean(temp.concat("portrait"), false);
}

public void configureAdColony(Activity act) {
try {
if (AppSpecificOrientation.LOG) Log.d(TAG, "version Code: " + getPackageManager().getPackageInfo(getPackageName(), 0).versionCode);
AdColony.configure(act, "version=" + getPackageManager().getPackageInfo(getPackageName(), 0).versionCode + ",store:google", "appc0bebfc9f4a3489fb82153", "vz9bf8a5eb30ef477798b82b"/*, "vz81c21390fa4e4b25aaa8ed", "vzf738e644f1394a9abcf4cf", "vz6494ace59eb4446db403f4"*/);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
}
// public void registerShared(DonateActivity donateActivity) {
// prefs.registerOnSharedPreferenceChangeListener(donateActivity);
// }
//
// public void unregisterShared(DonateActivity donateActivity) {
// prefs.unregisterOnSharedPreferenceChangeListener(donateActivity);
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
* Created by spiros on 8/14/13.
*/
public class BootReceiver extends BroadcastReceiver {
private static final String TAG = BootReceiver.class.getSimpleName();
AppSpecificOrientation appSpecificOrientation;
private static final String TAG = BootReceiver.class.getSimpleName();
AppSpecificOrientation appSpecificOrientation;

@Override
public void onReceive(Context context, Intent intent) {
@Override
public void onReceive(Context context, Intent intent) {

Log.d(TAG, "onReceived");
appSpecificOrientation = (AppSpecificOrientation) context.getApplicationContext();
if (AppSpecificOrientation.getBoot()) {
if (appSpecificOrientation.isServiceRunning()) {
Log.d(TAG, "Restarting Service");
context.startService(new Intent(context, NewOrieService.class));
}
}
}
Log.d(TAG, "onReceived");
appSpecificOrientation = (AppSpecificOrientation) context.getApplicationContext();
if (AppSpecificOrientation.getBoot()) {
if (appSpecificOrientation.isServiceRunning()) {
Log.d(TAG, "Restarting Service");
context.startService(new Intent(context, NewOrieService.class));
}
}
}
}
Loading

0 comments on commit 4c0d51c

Please sign in to comment.