Reputation: 3828
How do I install Google SDK for Android using Flash and AS3?
I see this in the docs but it doesn't look like AS3? Where do I put this code? Any good tutorials that teach a person how to do this?
Add the send methods to the onStart() and onStop() methods of each of your Activities as in the following example:
/**
* An example Activity in your app with Analytics
* implemented.
*/
public class myTrackedActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public void onStart() {
super.onStart();
... // The rest of your onStart() code.
EasyTracker.getInstance().activityStart(this); // Add this method.
}
@Override
public void onStop() {
super.onStop();
... // The rest of your onStop() code.
EasyTracker.getInstance().activityStop(this); // Add this method.
}
}
Note that EasyTracker requires Context before you can call its methods. In the above example, this line:
EasyTracker.getInstance.activityStart(this);
takes care of setting the context. However if you need to make EasyTracker calls in other classes or methods, you'll need to call EasyTracker's setContext(Context ctx) method first:
// Set Context before using EasyTracker. Note that the SDK will
// use the application context.
EasyTracker.getInstance().setContext(this);
// EasyTracker is now ready for use.
Upvotes: 0
Views: 699
Reputation:
Google SDK is used for creating native Android apps - in a Flash context, you could use it to build an AIR Adobe Native Extension for Android.
The link provides a starting point for building ANEs. Btw, code looks like Java to me (the default Android development language).
Upvotes: 1