Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating Count.ly To Android Application

I want to use Count.ly with my Android app. I'm newbie on Android. There is an installation documentation here but i couldn't follow these steps.

1) I've added this to my manifest file, inside <application>

<service android:name="org.openudid.OpenUDID_service">
    <intent-filter>
        <action android:name="org.openudid.GETUDID" />
    </intent-filter>
</service>

2) Added this to my MainActivity's onCreate() method.

OpenUDID_manager.sync(getApplicationContext());

        if(OpenUDID_manager.isInitialized())
        {
            String oudid = OpenUDID_manager.getOpenUDID();

        }

But i'm stuck at next step . What they mean with

Add Countly.java to your project under Eclipse.

? Just i should copy Countly.java to my /src/com/blabla/appname folder?

Also i don't know what should i do after this step.

like image 796
Eray Avatar asked Nov 02 '22 17:11

Eray


1 Answers

Solved. It was my mistake. I don't need to init OpenUDID on my project.

I just add these to my activity

@Override
    public void onStart()
    {
        super.onStart();
        Countly.sharedInstance().onStart();
    }

    @Override
    public void onStop()
    {
        Countly.sharedInstance().onStop();
        super.onStop();
    }

and this to onCreate()

Countly.sharedInstance().init(getApplicationContext(), "https://cloud.count.ly", "...");

And lastly copied src/org/* directory to my src dir , Countly.javafile to my package.

like image 112
Eray Avatar answered Nov 08 '22 05:11

Eray