GithubHelp home page GithubHelp logo

adjust / android_sdk Goto Github PK

View Code? Open in Web Editor NEW
584.0 584.0 296.0 34.77 MB

This is the Android SDK of

Home Page: http://www.adjust.com

License: Other

Java 92.74% JavaScript 3.77% Ruby 0.66% HTML 1.49% Kotlin 1.34%

android_sdk's People

Contributors

alosdev avatar alzbeta-knerova avatar elmacnifico avatar esamcgv avatar hellomarne avatar hellosagar avatar horie1024 avatar joernh avatar juandebravo avatar keyboardsurfer avatar lejohnduff avatar mahdiztd avatar mcoombs avatar nadinehattom avatar nicolas-brugneaux-sociomantic avatar nonelse avatar ntsk avatar ohdavit avatar rapimo avatar segoh avatar sergiiz avatar shashanksu avatar sighmoan avatar sporiff avatar studymike avatar tasomaniac avatar uerceg avatar valf1st avatar wellle avatar yaramatkova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android_sdk's Issues

License does not benefit contributions

It's come to my attention that the current license of the adjust_android_sdk is not an Open Source license.
This is why I can not provide further improvements / modifications of the SDK until an appropriate license is being chosen for it.
I'm sorry, but until an open source license is being attributed from within the source code I'll also have to remove my pull requests.
I'll be gladly submitting them again, once a contribution friendly license has been chosen and applied.

Adjust Singleton difficult to test

The Adjust Sigelton only provides static methods, which is just possible to mock with PowerMock, but this is not working with robolectric. So I suggest to move the Adjust Singleton implementation to a class
AdjustImpl which is instantiated statically and exposed with getInstance and setIntance to clients, so it is possible to mock its behavior.

Lifecycle callbacks

As a developer I want easy to use APIs.
Having to re-write code in every Activity lifecycle method is very redundant.
When I saw this, the first thing that came to my mind was "Are you kidding me?"

A framework that offers session tracking should handle tracking of sessions on it's own and without requiring developers to write redundant code.

Requiring developers to add code, that adeven relies on, to lifecycle methods will be forgotten, thus producing incorrect tracking and errors.

Please think of an easier way for developers to utilize session tracking, implement and release it.

Tracking revenue

Hello,
we are implementing a general app framework and provide several tracking services the user can enable. Inside the framework we have a kiosk system where the user can buy content. We need to be able to track this using different services. One of this tracking service is adjust. While we can track revenues with adjust, we only get the revenue in the users currency. We have no idea what currency is setup in the adjust dashboard.

In the documentation you state the following:

Please note that while the currency token must be set, adjust will not perform a currency conversion. You should always transmit revenues in the currency that you have set in your adjust dashboard.

This is utter bullshit and basicly prevents any correct usage of your service, as the real revenue will always be wrong if you don't manually hardcode the prices.

Is there something we are missing?

No Advertising ID with Play Services 7.5.0

When trying to upgrade the Play Services library to 7.5.0 (compile 'com.google.android.gms:play-services-gcm:7.5.0'), I've started getting the following error:
Unable to get Google Play Services Advertising ID at start time

Is the SDK v4.0.6 compatible with Play Services 7.5.0?

add convenience methods or constructors to events

The new tracking code is more verbose, it would be pretty easy to trim it down.

from this:

AdjustEvent e = new AdjustEvent(token);
e.setRevenue(rev, "USD");
Adjust.trackEvent(e);

to this

Adjust.trackEvent(new AdjustEvent(token, rev, "USD"));

or

Adjust.trackEvent(new AdjustEvent(token).revenue(rev, "USD"));

or

Adjust.trackEvent(AdjustEvent.revenueEvent(token, rev, "USD"));

I'm not picky.

Compile issues

I have added Adjust as a subtree using the latest commit on master (because of the missing imports on tag v3.6.1).

I am unable to run my app as soon as I add Adjust to my project gradle. I only get the following output in the gradle console. Always right after :subtrees:Adjust:Adjust:jar

Error:Cannot convert the provided notation to a File or URI: [src].
The following types/formats are supported:
  - A String or CharSequence path, e.g 'src/main/java' or '/usr/include'
  - A String or CharSequence URI, e.g 'file:/usr/include'
  - A File instance.
  - A URI or URL instance.

Any clue what might cause this?

When is OnFinishedListener really called?

I try to use the OnFinishedListener to get the TrackerName from the ResponseData.

I want to track it once with the app start so I thought I will try to set the listener after Adjust.onResume(activity) which is called in my splash screen onResume().
I was able to get it tracked once but I can't seem to make it work correctly on each app start.

I also tried to move it to the Application class. I called Adjust.onResume(), set the listener and called Adjust.onPause() directly in that order but again it is not fired.

The documentation on that topic is unclear for me (please see it here: https://github.com/adjust/android_sdk#11-set-listener-for-delegate-notifications ) mainly for 2 reasons:

  1. there is an OnClickListener mentioned which is never seen in any code snippet. Did you mean the OnFinishedListener instead?
  2. The sentence: The listener method onFinishedTracking will get called every time any activity was tracked or failed to track. is unclear for me as I have no real idea at which moment you actively consider an Activity tracked.

Can you help me to wrap my head around that?

Already have a referrer receiver

What if we already have a Receiver for referrer. Android apps cannot have multiple ReferrerReceivers? What to do in that case?

AdjustConfig compares objects not values for environment

Hello,

checkEnvironment() in AdjustConfig checks for a proper environment by comparing the String objects. We think comparing values should be in place.

Instead of:
environment == AdjustConfig.ENVIRONMENT_SANDBOX

use:
environment.equals(AdjustConfig.ENVIRONMENT_SANDBOX)

Please excuse me if I'm missing an important point.

I some 2.2/.3 devices the Http call returns SSLException: Not trusted server certificate

04-18 20:00:18.084: W/System.err(15572): javax.net.ssl.SSLException: Not trusted server certificate
04-18 20:00:18.084: W/System.err(15572):    at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:371)
04-18 20:00:18.084: W/System.err(15572):    at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:92)
04-18 20:00:18.084: W/System.err(15572):    at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:381)
04-18 20:00:18.084: W/System.err(15572):    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:174)
04-18 20:00:18.084: W/System.err(15572):    at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
04-18 20:00:18.088: W/System.err(15572):    at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
04-18 20:00:18.088: W/System.err(15572):    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)
04-18 20:00:18.088: W/System.err(15572):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
04-18 20:00:18.088: W/System.err(15572):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
04-18 20:00:18.088: W/System.err(15572):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
04-18 20:00:18.088: W/System.err(15572):    at com.adeven.adjustio.RequestTask.doInBackground(RequestTask.java:55)
04-18 20:00:18.088: W/System.err(15572):    at com.adeven.adjustio.RequestTask.doInBackground(RequestTask.java:1)
04-18 20:00:18.088: W/System.err(15572):    at android.os.AsyncTask$2.call(AsyncTask.java:185)
04-18 20:00:18.088: W/System.err(15572):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
04-18 20:00:18.088: W/System.err(15572):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
04-18 20:00:18.088: W/System.err(15572):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
04-18 20:00:18.092: W/System.err(15572):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
04-18 20:00:18.092: W/System.err(15572):    at java.lang.Thread.run(Thread.java:1096)
04-18 20:00:18.092: W/System.err(15572): Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: TrustAnchor for CertPath not found.
04-18 20:00:18.092: W/System.err(15572):    at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:168)
04-18 20:00:18.092: W/System.err(15572):    at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:366)
04-18 20:00:18.092: W/System.err(15572):    ... 17 more
04-18 20:00:18.096: W/System.err(15572): Caused by: java.security.cert.CertPathValidatorException: TrustAnchor for CertPath not found.
04-18 20:00:18.100: W/System.err(15572):    at org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi.engineValidate(PKIXCertPathValidatorSpi.java:149)
04-18 20:00:18.100: W/System.err(15572):    at java.security.cert.CertPathValidator.validate(CertPathValidator.java:202)
04-18 20:00:18.104: W/System.err(15572):    at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:164)
04-18 20:00:18.104: W/System.err(15572):    ... 18 more
04-18 20:00:18.104: D/AdjustIo(15572): This SDK requires the INTERNET permission. You might need to adjust your manifest. See the README for details.

Google Advertising ID

The README section of this repository mentions this :

Since the 1st of August of 2014, apps in the Google Play Store must use the Google Advertising ID to uniquely identify the devices. To allow the adjust SDK to use the Google Advertising ID, you must integrate the Google Play Services.

Unless I missed something, I can't find any usage of this id beside this logging [0].

Is the google play service really mandatory ?

[0] https://github.com/adjust/android_sdk/blob/master/Adjust/src/com/adjust/sdk/ActivityHandler.java#L281

Gradle build file improvements

Hi guys, first of all, thanks for this awesome tracking solution.
Second, I am working on a project that currently based on Maven, so I wanted a clean solution to build Adjust into a jar and upload it to the local Maven repository. Thought this might help you and other users. Cheers.

apply plugin: 'android-library'
apply plugin: 'maven'

buildscript {
    repositories {
        mavenCentral()
        mavenLocal()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:0.9+'
    }
}

repositories {
    mavenCentral()
    mavenLocal()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

android {
    buildToolsVersion "19.0.3"
    compileSdkVersion 19
    defaultConfig {
        versionCode 11
        versionName '3.3.0'
        minSdkVersion 9
        targetSdkVersion 19
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
    }
}

task coreLibJar(type: Jar) {
    from fileTree(dir: 'build/classes/release').matching { include 'com/adjust/sdk/**' }
}
artifacts {
    archives coreLibJar
}

uploadArchives {
    repositories {
        mavenDeployer {
            repository(url: "file:///Users/xxx/my_maven_repo")
            pom.groupId = 'com.adjust.sdk'
            pom.artifactId = 'adjust-android'
            pom.version = '3.3.0'
        }
    }
}

Typo in Readme.md

In Topic 7, you have a small typo: orPause instead of onPause:

In your Activity's orPause method call Adjust.onPause. Create the method if needed.

Unable to get Google Play Services Advertising ID at start time

In PRODUCTION mode the SDK does not receive the Google Play Services Advertising ID, so it is not possible to track a session.

09-18 14:24:06.304 3262-3317/? A/Adjust﹕ PRODUCTION: Adjust is running in Production mode. Use this setting only for the build that you want to publish. Set the environment to sandbox if you want to test your app!
09-18 14:24:06.324 3262-3317/? I/Adjust﹕ Unable to get Google Play Services Advertising ID at start time
09-18 14:24:06.334 3262-3317/? I/Adjust﹕ First session
09-18 14:24:06.774 3262-3322/? E/Adjust﹕ Failed to track session. (Missing device identifiers)

Delegate Callbacks in SDK

We are missing the ability to receive callbacks client-side on

  • session
  • install and
  • reattribution events

in the SDK version 4.x.

We need these to be able to sync adjust.io with other tracking tools client-side.

We need the same information as the one which was available in SDK version 3.x, i.e.:

- AIActivityKind activityKind indicates what kind of activity was tracked. It has one of these values:
     (AIActivityKindSession, AIActivityKindEvent, AIActivityKindRevenue, AIActivityKindReattribution)
- NSString trackerToken the tracker token of the current install.
- NSString trackerName the tracker name of the current install.
- NSString network the network grouping level of the current install.
- NSString campaign the campaign grouping level of the current install.
- NSString adgroup the ad group grouping level of the current install.
- NSString creative the creative grouping level of the current install.

NullPointerException in RequestTask

If the RequestTask fails for some reason the AsyncTask returns null and onPostExecute will call Log.d with a null string throwing a NullPointerException.

A simple fix could be a check if the returned value is null or returning a non null string in doBackground.

The serious part is that the method runs inside a AsyncTask so no try/catch can be performed and it will crash the application.

Please find attached the stacktrace:

java.lang.NullPointerException: println needs a message
    at android.util.Log.println_native(Native Method)
    at android.util.Log.d(Log.java:122)
    at com.adeven.adjustio.RequestTask.onPostExecute(RequestTask.java:100)
    at com.adeven.adjustio.RequestTask.onPostExecute(RequestTask.java:1)
    at android.os.AsyncTask.finish(AsyncTask.java:417)
    at android.os.AsyncTask.access$300(AsyncTask.java:127)
    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:123)
    at android.app.ActivityThread.main(ActivityThread.java:4633)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:521)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    at dalvik.system.NativeStart.main(Native Method)

With kindest regards
Sobrinho

Adjust tracking event when push received while app not running

I try to implement a tracking event that should be triggered when a push message is received.

When my push notification is received while an activity of my app is visible, everything works as expected. I see my own logcat message showing details about the tracking event and the message from Adjust stating the same: "I/Adjust﹕ Tracked revenue ...."

My problem appears when my app is closed and not running. When I receive the push my own log message appears but there is no sign from Adjust anywhere. No error message, no statement that something might not be initialized, nothing.
Starting the application afterwards does not trigger anything as well, so there is no "buffer". (AdjustEventBuffering is set to false anyway...)

Any ideas what I might do wrong?

(Tested with 3.3.x and 3.6.0)

Transaction id

How i can set Transaction id in android SDK like iOS SDK?

/**

  • Set the transaction ID of a In-App Purchases to avoid revenue duplications.
    *
  • A transaction ID can be used to avoid duplicate revenue events. The last ten
  • transaction identifiers are remembered.
    *
  • @param transactionId The identifier used to avoid duplicate revenue events
    */
    • (void) setTransactionId:(NSString *)transactionId;

Reporting revenue show doubled events

After updating SDK, I'm reporting revenue like shown in migrate manual:

AdjustEvent event = new AdjustEvent("abc123");
event.setRevenue(0.01, "EUR");
Adjust.trackEvent(event);

but after such changes, in dashboard I always see two events reported for one revenue. Is it some kind of bug? or it should be configured somehow?

NPE in updateActivityState

Hi,

There is the report from Crashlytics :


java.lang.NullPointerException: Attempt to read from field 'long com.adjust.sdk.ActivityState.lastActivity' on a null object reference
       at com.adjust.sdk.ActivityHandler.updateActivityState(ActivityHandler.java:706)
       at com.adjust.sdk.ActivityHandler.endInternal(ActivityHandler.java:520)
       at com.adjust.sdk.ActivityHandler.access$400(ActivityHandler.java:34)
       at com.adjust.sdk.ActivityHandler$SessionHandler.handleMessage(ActivityHandler.java:361)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:135)
       at android.os.HandlerThread.run(HandlerThread.java:61)
 

This crash is occuring on a rooted OnePlusOne device, can't reproduce it & using Adjust 4.0.9.

How is it possible to fix that ?

NullPointerException sendClickPackage

Hi,

Since 4.0.6 were are experiencing crashs with Adjust. Here's the stacktrace from crashlytics :


java.lang.NullPointerException
       at com.adjust.sdk.PackageHandler.sendClickPackage(PackageHandler.java:121)
       at com.adjust.sdk.ActivityHandler.sendReferrerInternal(ActivityHandler.java:529)
       at com.adjust.sdk.ActivityHandler.access$800(ActivityHandler.java:38)
       at com.adjust.sdk.ActivityHandler$SessionHandler.handleMessage(ActivityHandler.java:353)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.os.HandlerThread.run(HandlerThread.java:60)
 

I've implemented Adjust.onResume() & Adjust.onPause() in all activities.
I'm sending INSTALL_REFERRER broadcast message thru my own BroadCastReceiver with :


public class InstallReferrerReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        // Adjust
        new com.adjust.sdk.AdjustReferrerReceiver().onReceive(context, intent);
        //....
    }
}

I can't manage to reproduce this one. It seems to happen only on rooted devices.

Set environment in code

Currently environment is set via meta-data which is defined at compile time. If we could set environment in code it would be easy to just switch environments based on BuildConfig.DEBUG.

The current method introduces a possible point of error when creating a deployable apk since the developer has to remember to switch to production.

How to get notified for track finish events in 4.0.4

Hi,

In previous versions, there was the ability to setOnFinishedListener passing in a OnFinishedListener to get notified about track events. This listener seems to have been removed. Has the capability been removed too or is there another way to do this in 4.0.4?

Thanks,
Yixin

serialization error on startup of latest 4.x sdk

Does this serialization error mean any user who gets this version will lose tracking data, or is this recoverable?

I/Adjust﹕ Event buffering is enabled                                                                                                                                                                                                                                                                  
E/Adjust﹕ Failed to read Activity state object (com.adjust.sdk.ActivityState; Incompatible class (SUID): com.adjust.sdk.ActivityState: static final long serialVersionUID =8486336867555666864L; but expected com.adjust.sdk.ActivityState: static final long serialVersionUID =1983630276878825549L;)
I/Adjust﹕ Started subsession 2 of session 1                                                                                                                                                    

HTTP 500 errors for too frequent sessions

I've been trying to pare down HTTP and network errors in our app, and I noticed via Charles Proxy and NewRelic that Adjust is encountering a lot of HTTP 500 errors. It was primarily requesting When I looked into the body of the response it seemed to indicate this is an expected error:

{"timestamp":"2015-05-27T02:44:54.937Z+0000","message":"Session failed (Ignoring too frequent session. Last session: 2015-05-26T16:44:53, this session: 2015-05-26T16:48:47, interval: 3m54s, min interval: 20m) (app_token: <a real app token here>, adid: <a real adid here>)"}

The Adjust SDK on our Android client is making these requests on its own when a user closes and opens the app. This is quite normal behavior. Why is it using an HTTP 5xx error code to indicate an unexpected failure if this is expected behavior? And why is this only happening on the Android client and not iOS?

There should be a better solution for phoning home to the Adjust servers and the Adjust backend should use a different HTTP code so its not categorized as an error. 429 Too Many Requests would be better.

As a side note, I read in the documentation that 30 minutes should be the session interval, and it seems that such a constant is in the Android client SDK. Shouldn't the client therefore respect that interval and not attempt to query so often?

Using Adjust new SDK in Eclipse IDE

We are working on our Android product and which has not been upgraded to Android Studio yet. Can you please tell me how to use your updated SDK into eclipse project?
Currently we are using old SDK.

Thanks,

maven repo?

Is this SDK deploying in a maven repo somewhere?

Add Ant Support

Include build.xml and local.properties to support ant builds as suggested by Sergio.

Ant build failure logs: https://gist.github.com/wellle/5796507

How to create the missing files:

sergio:~/git/adeven_adjust_android_sdk$ android update project -p ~/git/adeven_adjust_android_sdk/AdjustIo
Updated local.properties
No project name specified, using project folder name 'AdjustIo'.
If you wish to change it, edit the first line of build.xml.
Added file /Users/sergio/git/adeven_adjust_android_sdk/AdjustIo/build.xml
Added file /Users/sergio/git/adeven_adjust_android_sdk/AdjustIo/proguard-project.txt
It seems that there are sub-projects. If you want to update them
please use the --subprojects parameter.

Add support for Google Play Services version 7.0.0

Hello,

We are unable to setup Adjust.

According to the logs we first have this message:
E/Adjust﹕ Missing device id's. Please check if Proguard is correctly set with Adjust SDK

However, we have our build with minifyEnabled set to false. So we are not using Proguard.

After that log message we also have this ones:


E/Adjust﹕ Session failed (Missing device identifiers) (app_token: OUR_APP_TOKEN)
E/Adjust﹕ Attribution request failed (Missing device identifiers) (app_token: OUR_APP_TOKEN)
E/Adjust﹕ Attribution request failed (Missing device identifiers) (app_token: OUR_APP_TOKEN)

We have the AndroidManifest with the broadcast receiver and we setup Adjust on our Application onCreate method (by calling the method listed below).

private void setupAdjust() {
        String appToken = getString(R.string.adjustAppToken);
        String environment = getString(R.string.adjustEnvironment);
        AdjustConfig config = new AdjustConfig(this, appToken, environment);
        config.setLogLevel(LogLevel.WARN);
        Adjust.onCreate(config);
}

Any ideas on what it could be?

`dex` issue with `com.google.android.gms:play-services-ads`

Hi guys

During Adjust setup, can we skip the step 4?

Even with compile 'com.google.android.gms:play-services-ads:7.3.0' it is causing dex issue.
Can we use compile 'com.google.android.gms:play-services-base:7.3.0' instead?

Best regards
Kamol

Don't Start Session When Calling Adjust.onCreate()

The example shows Adjust.onCreate() being called in the Application class.

It seems that Adjust.onCreate() also starts a session: https://github.com/adjust/android_sdk/blob/master/Adjust/adjust/src/main/java/com/adjust/sdk/ActivityHandler.java#L398

This doesn't make sense for a lot of cases. Broadcast Receivers and background Services will initialise the Application class, causing a session to be tracked even though the user hasn't actually interacted with the app.

A better solution would be to start a session the first time Adjust.onResume() is called. That way we know the user is interacting with an Activity

Will OnAttributionChangedListener Be Called If Device Data is Wiped?

Hey,

Looking through the code - it seems as is OnAttributionChangedListener won't be called in the case of data clear on the device.

For example, using Mixpanel, if open the app the first time I'll correctly get the OnAttributionChangedListener called and my events will be properly attributed. But if I wipe the data, I'll have a new Mixpanel profile, but the OnAttributionChangedListener won't be called again it seems.

Is this intended? Or did I miss something?

Cheers!

Please consider adding an option to disable ANDROID_ID collection

Some security-conscious organizations don't want to ship any libraries that collect ANDROID_ID because its sensitive information. Those organizations are left with the choice of either forking your library and maintaining a fork with the ANDROID_ID collection turned off or using a competitor. We would rather not use a fork which will quickly get out of date. Please consider adding an API like AdjustConfig.setCollectAndroidId(false) that we can call during initialization so we don't have to maintain a fork.

Or if we submitted a pull request with such a feature, would you potentially merge it?

Session control

I'm currently implementing the new 4.0.2 SDK version, and sometimes when the Adjust tries to track the session it sends:

E/Adjust﹕ Failed to parse response (Content has been consumed)
V/Adjust﹕ Response: null

and after this happens none of the following events are tracked and the same response is given.

I've been searching for a possible cause, and testing scenarios, and I've read that in previous versions the session would some how persist for 30 minutes, and I also noticed that when I install the app the session and all the events that follow are tracked correctly, but if I uninstall and install again the session gives the error described above. Only if I wait some time the session again correctly tracked and so are the following events.

Is this the expected behavior? Do I have to wait another 30 minutes to test my trackers if I uninstall the app, or is there a workaround?

Thanks.

Update Android Studio documentation?

We use Android Studio to build apps and the documentation to install Adjust SDK is out of date:
https://github.com/adjust/android_sdk/blob/master/doc/android_studio.md

The Google issue is fixed.

A couple of issues:

  1. Can you guys update these docs to remove the workaround? I believe more recent versions of Android Studio allow for importing modules.

  2. Is there a way to use Adjust through the Maven central repository, so that installation is just one line in build.gradle?

crash

crashlytics report bug:

java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
       at java.lang.Thread.nativeCreate(Thread.java)
       at java.lang.Thread.start(Thread.java:1063)
       at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:920)
       at java.util.concurrent.ThreadPoolExecutor.ensurePrestart(ThreadPoolExecutor.java:1553)
       at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:306)
       at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleWithFixedDelay(ScheduledThreadPoolExecutor.java:567)
       at java.util.concurrent.Executors$DelegatedScheduledExecutorService.scheduleWithFixedDelay(Executors.java:653)
       at com.adjust.sdk.ActivityHandler.startTimer(ActivityHandler.java:687)
       at com.adjust.sdk.ActivityHandler.startInternal(ActivityHandler.java:392)
       at com.adjust.sdk.ActivityHandler.access$300(ActivityHandler.java:36)
       at com.adjust.sdk.ActivityHandler$SessionHandler.handleMessage(ActivityHandler.java:312)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:145)
       at android.os.HandlerThread.run(HandlerThread.java:61)

what can i do to fix it?

IllegalStateException at com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo()

Updated yesterday to adjust_sdk-3.3.3 and integrated into our project as described in the README.

First run showed:

I/Adjust(18539): Unable to get Google Play Services Advertising ID at start time

Next, I added e.printStackTrace() to com.adjust.sdk.Util.java after line 378 and got the following output:

W/System.err(18539): Caused by: java.lang.IllegalStateException: Calling this from your main thread can lead to deadlock
W/System.err(18539):    at com.google.android.gms.internal.fq.ak(Unknown Source)
W/System.err(18539):    at com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(Unknown Source)

This might be caused by not following Googles advice on calling advertising ID APIs, see https://developer.android.com/google/play-services/id.html

especially:
"Note: The getAdvertisingIdInfo() method is a blocking call, so you must not call it on the main (UI) thread. If called on the main thread, the method throws IllegalStateException."

Event buffering

I am trying to understand Event buffering
https://github.com/adjust/android_sdk#15-enable-event-buffering

From what I understand from above documentation that Adjust batches all events into one request and send it after a minute. But that's not the behavior I am seeing, unless I am misreading the docs. I see that it waits 1 minute but it sends all events in their individual requests. For example, if there were 3 events occurred, then it will send 3 requests after a minute.

Please clarify. Thanks!

Use of Activity Context - Potential Memory Leak

I notice that the Adjust constructor takes an Activity context, and passes it to an ActivityHandler that extracts the Application’s context:

this.
 context=
 context.getApplicationContext();

In my analysis, I find this to be keeping many other objects throughout our app from being released, leading to OutOfMemoryError exceptions and thus crashes. Can this be reworked so it uses the main Application Context directly?

Please find the screenshot of a sample MemoryAnalyzer row.

screen shot 2014-11-21 at 5 04 00 pm

Intstall Referrer & Mixpanel Tracking Integration

Hi guys,

I was wondering if it's possible to retrieve the Adjust tracker upon install, without using the Adjust Events API?

Essentially we want to know where the install came from, and forward the data to Mixpanel. It seems this is possible when an event is sent - Adjust Mixpanel Integration - but not for when the app is installed.

Cheers,
T-Spoon

Failed to track my event

Hello,

I was struggling with this issue for a while and I decided to write to you guys because I don't know if the problem is on my side or with the SDK or something else. We have few event tags and for each we get :E/Adjust﹕ Failed to track event 'XXXX'. (Event Token for wrong app: 'XXXX')

I am not sure what can be wrong. Maybe you can help.

To have bigger picture about this, here is a log: (the app starts and I click the button under which I want to send an event):

A/Adjust﹕ SANDBOX: Adjust is running in Sandbox mode. Use this setting for testing. Don't forget to set the environment to production before publishing!
D/Adjust﹕ Package handler read 0 packages
D/Adjust﹕ Unable to read new field in migration device with error (no field 'enabled' of type boolean)
D/Adjust﹕ Read activity state: ec:1 sc:1 ssc:3 sl:82.5 ts:43.1 la:12:42:38 uuid:XXX
I/Adjust﹕ Started subsession 4 of session 1
D/Adjust﹕ Wrote activity state: ec:1 sc:1 ssc:4 sl:95.8 ts:43.1 la:12:42:51
D/Adjust﹕ Wrote activity state: ec:1 sc:1 ssc:4 sl:96.8 ts:44.1 la:12:42:52
D/Adjust﹕ onPause
D/Adjust﹕ Added package 1 (event 'YYXXYY')
V/Adjust﹕ Path: /event
UserAgent: XXX phone Nexus4 android 19 pl PL normal normal high 768 1184
ClientSdk: android3.6.1
Parameters:
fb_id xxx
subsession_count 4
session_count 1
android_uuid xxx
android_id xxx
event_token YYXXYY
environment sandbox
session_length 101
tracking_enabled 1
time_spent 48
app_token xxx
created_at 2014-10-24T12:42:56Z+0200
gps_adid xxx
event_count 2
D/Adjust﹕ Wrote activity state: ec:2 sc:1 ssc:4 sl:100.5 ts:47.9 la:12:42:56
D/Adjust﹕ Event 2
D/Adjust﹕ Wrote activity state: ec:2 sc:1 ssc:4 sl:100.8 ts:48.2 la:12:42:56
D/Adjust﹕ Package handler wrote 1 packa ges
D/Adjust﹕ Wrote activity state: ec:2 sc:1 ssc:4 sl:100.9 ts:48.2 la:12:42:56
E/Adjust﹕ Failed to track event ‚YYXXYY'. (Event Token for wrong app: 'YYXXYY') -- here is error
D/Adjust﹕ Package handler wrote 0 packages
D/Adjust﹕ Wrote activity state: ec:2 sc:1 ssc:4 sl:101.8 ts:49.1 la:12:42:57

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.