Permalink
Browse files

updated API

  • Loading branch information...
1 parent 6a30cdb commit d87432db5e9d1f82782ce28eeffc190d4f321d95 @uwemaurer uwemaurer committed Oct 27, 2011
View
Binary file not shown.
@@ -22,12 +22,12 @@
<!-- AppBrain SDK -->
<activity android:configChanges="keyboard|keyboardHidden|orientation"
android:name="com.appbrain.AppBrainActivity" />
- <receiver android:exported="true" android:name="com.appbrain.ads.ReferrerReceiver" >
+ <receiver android:exported="true" android:name="com.appbrain.ReferrerReceiver" >
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
- <service android:name="com.appbrain.ads.SendService" />
+ <service android:name="com.appbrain.SendService" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
Binary file not shown.
@@ -20,10 +20,10 @@ public void onCreate(Bundle savedInstanceState) {
AppBrain.init(this);
setContentView(R.layout.main);
- RemoteSettings settings = AppBrain.getRemoteSettings();
+ RemoteSettings settings = AppBrain.getSettings();
String welcomeMessage = settings.get("welcome_message", "Hello");
Toast.makeText(this, welcomeMessage, Toast.LENGTH_LONG).show();
- final AdService ads = AppBrain.getAdService();
+ final AdService ads = AppBrain.getAds();
findViewById(R.id.show_interstitial).setOnClickListener(new OnClickListener() {
@@ -62,7 +62,7 @@ public void run() {
// @Override
public void onBackPressed() {
- AppBrain.getAdService().maybeShowInterstitial(this);
+ AppBrain.getAds().maybeShowInterstitial(this);
finish();
}
@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 11:20:12 CEST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 16:22:34 CEST 2011 -->
<TITLE>
All Classes
</TITLE>
@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 11:20:12 CEST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 16:22:34 CEST 2011 -->
<TITLE>
All Classes
</TITLE>
@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 11:20:12 CEST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 16:22:34 CEST 2011 -->
<TITLE>
AdService
</TITLE>
@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 11:20:12 CEST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 16:22:34 CEST 2011 -->
<TITLE>
AppBrain
</TITLE>
@@ -44,7 +44,17 @@
</PRE>
<P>
-This class provides static methods to access the AppBrain services, such as Ads and RemoteSettings.
+Entry point to the AppBrain AppLift SDK.
+
+ For any method you call, init(context) always needs to be called first. It's
+ strongly advised to put this into your onCreate of all your Activities, or of
+ your Application object if you have one. If you put this in your Activities'
+ onCreate, don't forget to also check your Services and BroadcastReceivers for
+ potential other entry points into your app.
+
+ Otherwise you can call AppBrain.init(context) right before any calls to
+ getAds or getSettings, but in that case you won't get an accurate number of
+ active users, and loading of remote settings will be less frequent.
<P>
<P>
@@ -67,26 +77,27 @@
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../com/appbrain/AdService.html" title="interface in com.appbrain">AdService</A></CODE></FONT></TD>
-<TD><CODE><B><A HREF="../../com/appbrain/AppBrain.html#getAdService()">getAdService</A></B>()</CODE>
+<TD><CODE><B><A HREF="../../com/appbrain/AppBrain.html#getAds()">getAds</A></B>()</CODE>
<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get an AdService implementation, which allows you to show AppBrain
+ Promoted Apps.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../com/appbrain/RemoteSettings.html" title="interface in com.appbrain">RemoteSettings</A></CODE></FONT></TD>
-<TD><CODE><B><A HREF="../../com/appbrain/AppBrain.html#getRemoteSettings()">getRemoteSettings</A></B>()</CODE>
+<TD><CODE><B><A HREF="../../com/appbrain/AppBrain.html#getSettings()">getSettings</A></B>()</CODE>
<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the values that were set on the server.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../com/appbrain/AppBrain.html#init(Context)">init</A></B>(Context&nbsp;context)</CODE>
<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The init method needs to be called before using any other methods.</TD>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initialize the AppBrain AppLift SDK.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
@@ -111,26 +122,35 @@
</TR>
</TABLE>
-<A NAME="getAdService()"><!-- --></A><H3>
-getAdService</H3>
+<A NAME="getAds()"><!-- --></A><H3>
+getAds</H3>
<PRE>
-public static <A HREF="../../com/appbrain/AdService.html" title="interface in com.appbrain">AdService</A> <B>getAdService</B>()</PRE>
+public static <A HREF="../../com/appbrain/AdService.html" title="interface in com.appbrain">AdService</A> <B>getAds</B>()</PRE>
<DL>
+<DD>Get an AdService implementation, which allows you to show AppBrain
+ Promoted Apps.
+
+ AppBrain.init needs to be called before this method!
+<P>
<DD><DL>
-<DT><B>Returns:</B><DD>the AdService object</DL>
+<DT><B>Returns:</B><DD>An AdService implementation</DL>
</DD>
</DL>
<HR>
-<A NAME="getRemoteSettings()"><!-- --></A><H3>
-getRemoteSettings</H3>
+<A NAME="getSettings()"><!-- --></A><H3>
+getSettings</H3>
<PRE>
-public static <A HREF="../../com/appbrain/RemoteSettings.html" title="interface in com.appbrain">RemoteSettings</A> <B>getRemoteSettings</B>()</PRE>
+public static <A HREF="../../com/appbrain/RemoteSettings.html" title="interface in com.appbrain">RemoteSettings</A> <B>getSettings</B>()</PRE>
<DL>
+<DD>Get the values that were set on the server.
+
+ AppBrain.init needs to be called before this method!
+<P>
<DD><DL>
-<DT><B>Returns:</B><DD>the RemoteSettings object</DL>
+<DT><B>Returns:</B><DD>An object containing all values that were set on the server.</DL>
</DD>
</DL>
<HR>
@@ -140,10 +160,11 @@
<PRE>
public static void <B>init</B>(Context&nbsp;context)</PRE>
<DL>
-<DD>The init method needs to be called before using any other methods.
+<DD>Initialize the AppBrain AppLift SDK.
<P>
<DD><DL>
-<DT><B>Parameters:</B><DD><CODE>context</CODE> - Activity or Application context</DL>
+<DT><B>Parameters:</B><DD><CODE>context</CODE> - The Activity or Application context. It is safe to pass any kind of context
+ here, the SDK will only save context.getApplicationContext().</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 11:20:12 CEST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 16:22:34 CEST 2011 -->
<TITLE>
RemoteSettings
</TITLE>
@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 11:20:12 CEST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 16:22:34 CEST 2011 -->
<TITLE>
com.appbrain
</TITLE>
@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 11:20:12 CEST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 16:22:34 CEST 2011 -->
<TITLE>
com.appbrain
</TITLE>
@@ -58,7 +58,7 @@
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../com/appbrain/AppBrain.html" title="class in com.appbrain">AppBrain</A></B></TD>
-<TD>This class provides static methods to access the AppBrain services, such as Ads and RemoteSettings.</TD>
+<TD>Entry point to the AppBrain AppLift SDK.</TD>
</TR>
</TABLE>
&nbsp;
@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 11:20:12 CEST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 16:22:34 CEST 2011 -->
<TITLE>
Constant Field Values
</TITLE>
View
@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 11:20:12 CEST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_20) on Thu Oct 27 16:22:34 CEST 2011 -->
<TITLE>
API Help
</TITLE>
View
@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc on Thu Oct 27 11:20:12 CEST 2011-->
+<!-- Generated by javadoc on Thu Oct 27 16:22:34 CEST 2011-->
<TITLE>
Generated Documentation (Untitled)
</TITLE>

0 comments on commit d87432d

Please sign in to comment.