profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/djih/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Daniel Jih djih @amplitude San Francisco, CA www.danieljih.com

amplitude/FlappySwift 2

swift implementation of flappy bird. More at fullstackedu.com

amplitude/tvOS-Carthage-Demo-App 0

A demo app to test tvOS (iOS) SDK integration via Carthage

djih/cs224u 0

Code for Stanford CS224u

djih/cs242-fall14-lambda 0

CS242 lambda evaluator lab

issue commentamplitude/Amplitude-Java

Trying to create a simple Java example, part 2

Updates: We added the IMPORTANT NOTE to the developer center for this issue.
Thanks for letting us know the potential problem our customer might have.

sgpennebaker

comment created time in a day

issue commentamplitude/Amplitude-Java

SDK did not exception when wrong apikey, also do you have the way to enable log when using sdk ?

Hi @dantetam , Thank you for quickly response on this. I have just take a look at sdk source code. Could you please consider change apiKey parameter from String to char[] ? Cause I am using char[] to store key as below advice. I can change to String when call Amplitude but I think it's better if char[] is used. https://www.baeldung.com/java-storing-passwords

image

TuanDang1509

comment created time in 2 days

issue commentamplitude/Amplitude-Java

SDK did not exception when wrong apikey, also do you have the way to enable log when using sdk ?

Good catch on the Java version issue @TuanDang1509 . That's been fixed now.

That's also good reporting for the wrong API key case. We'll improve on that.

TuanDang1509

comment created time in 2 days

issue commentamplitude/Amplitude-Java

SDK did not exception when wrong apikey, also do you have the way to enable log when using sdk ?

Please update your document about sdk version. Cause the version below was fail when build with jdk 11

image

TuanDang1509

comment created time in 2 days

issue openedamplitude/Amplitude-Java

SDK did not exception when wrong apikey, also do you have the way to enable log when using sdk ?

<!--- Please fill out the template to the best of your ability --> Using wrong api-key but sdk without thow or log any exception.

image

Expected Behavior

Should throw out clearly exception about wrong credentials.

Current Behavior

Just keep silent in case wrong key.

Possible Solution

Should throw out clearly exception about wrong credentials. Should not retry hundred times in case wrong key.

Steps to Reproduce

image

Environment

  • Unity Plugin Version: <!--- E.g. v1.6.0 -->
  • Device: <!-- E.g. iPhone 11, Samsung Galaxy S20 -->
  • Device OS and Version: <!-- E.g. iOS 13.3.1, Android 8.1.0 -->

created time in 2 days

issue commentamplitude/Amplitude-Java

Trying to create a simple Java example, part 2

thanks @yuhao900914, the code below is good enough for sign of life, but would be good to mention the thread requirement in the "how to" doc at https://developers.amplitude.com/docs/java. i admit i also didn't want to mess with Spring that much, just needed something simple out of the gate. thanks to you and @dantetam for the help!

package com.carbon.amplitude;

import com.amplitude.Amplitude;
import com.amplitude.Event;

public class AmplitudeAsyncSend {

    public static void main( String[] args ) {

        System.out.println( "Hello World!" );

        Amplitude amplitude = Amplitude.getInstance();
        amplitude.init("d32f903389dd1ef7c0cc5a6c978ab13e" );

        amplitude.logEvent( new Event("ButtonClicked", "test_user_id" ) );

        Runnable thread = new Runnable()
        {
            public void run()
            {
                while( 1 == 1 ) { }
            }
        };

        new Thread( thread ).start();
    }
}
sgpennebaker

comment created time in 2 days

issue commentamplitude/Amplitude-Java

Trying to create a simple Java example, part 2

Will close this issue since the question got answered. Feel free to reopen or create new ticket if you need other help.

sgpennebaker

comment created time in 2 days

issue closedamplitude/Amplitude-Java

Trying to create a simple Java example, part 2

nope, sorry, i'm back and still failing. replaced the jar w java-sdk-1.2.0

the code:

import com.amplitude.Amplitude;
import com.amplitude.Event;

public class AmplitudeSend {

    public static void main( String[] args ) {

        System.out.println( "Hello World!" );

        Amplitude amplitude = Amplitude.getInstance();
        amplitude.init("LET ME KNOW IF YOU NEED THIS" );

        amplitude.logEvent( new Event("ButtonClicked", "test_user_id" ) );
    }
}

the IDE console looks fine.

i go and look at my test project in the Amplitude dash and the count does not increment.

i didn't mention this before but i am able to do curl:

#!/bin/bash
curl --header "Content-Type: application/json" \
  --header "Accept: */*" \
  --request POST \
  --data '{ "api_key": "LET ME KNOW IF YOU NEED THIS", "events": [ { "user_id": "datamonster@gmail.com", "device_id": "C8F9E604-F01A-4BD9-95C6-8E5357DF265D", "event_type": "watch_tutorial", "time": 1622783058 } ] }' \
  https://api2.amplitude.com/2/httpapi

this succeeds and the event count does increment.

if it's helpful, the client is Carbon Health and the project is SGP Test.

thanks in advance!

Originally posted by @sgpennebaker in https://github.com/amplitude/Amplitude-Java/issues/12#issuecomment-861903638

closed time in 2 days

sgpennebaker

issue commentamplitude/Amplitude-Java

Trying to create a simple Java example, part 2

@yuhao900914 aha, thanks for the tip - in search of the simplest possible example i skipped the thread part of your example, not understanding it's purpose. so, couldn't hurt to document that, and i apologize if it IS documented and i breezed by it. i'll fix up my example to be better behaved a little later today and update this thread with what i discover. thanks!

sgpennebaker

comment created time in 2 days

issue commentamplitude/Amplitude-Java

Trying to create a simple Java example, part 2

Hi @sgpennebaker, I'm able to reproduce on my side. I guess it's doesn't matter if the getInstance() has input or not.

May I ask if your main thread has the logic waiting for other threads? If not, that will cause an issue. We have an async call when calling the server, which will start a thread. But if the main thread terminate early than the daemon thread, the other threads will be killed.

sgpennebaker

comment created time in 2 days

issue commentamplitude/Amplitude-Java

Trying to create a simple Java example, part 2

let me know if it'd be helpful to zoom or slack or something

sgpennebaker

comment created time in 4 days

issue openedamplitude/Amplitude-Java

Trying to create a simple Java example, part 2

nope, sorry, i'm back and still failing. replaced the jar w java-sdk-1.2.0

the code:

import com.amplitude.Amplitude;
import com.amplitude.Event;

public class AmplitudeSend {

    public static void main( String[] args ) {

        System.out.println( "Hello World!" );

        Amplitude amplitude = Amplitude.getInstance();
        amplitude.init("LET ME KNOW IF YOU NEED THIS" );

        amplitude.logEvent( new Event("ButtonClicked", "test_user_id" ) );
    }
}

the console looks fine.

i go and look at my test project in the Amplitude dash and the count does not increment.

i didn't mention this before but i am able to do curl:

#!/bin/bash
curl --header "Content-Type: application/json" \
  --header "Accept: */*" \
  --request POST \
  --data '{ "api_key": "LET ME KNOW IF YOU NEED THIS", "events": [ { "user_id": "datamonster@gmail.com", "device_id": "C8F9E604-F01A-4BD9-95C6-8E5357DF265D", "event_type": "watch_tutorial", "time": 1622783058 } ] }' \
  https://api2.amplitude.com/2/httpapi

this succeeds and the event count does implement.

if it's helpful, the client is Carbon Health and the project is SGP Test.

thanks in advance!

Originally posted by @sgpennebaker in https://github.com/amplitude/Amplitude-Java/issues/12#issuecomment-861903638

created time in 4 days

issue commentamplitude/Amplitude-Java

Trying to create a simple Java example

nope, sorry, i'm back and still failing. replaced the jar w java-sdk-1.2.0

the code:

import com.amplitude.Amplitude;
import com.amplitude.Event;

public class AmplitudeSend {

    public static void main( String[] args ) {

        System.out.println( "Hello World!" );

        Amplitude amplitude = Amplitude.getInstance();
        amplitude.init("LET ME KNOW IF YOU NEED THIS" );

        amplitude.logEvent( new Event("ButtonClicked", "test_user_id" ) );
    }
}

the console looks fine.

i go and look at my test project in the Amplitude dash and the count does not increment.

i didn't mention this before but i am able to do curl:

#!/bin/bash
curl --header "Content-Type: application/json" \
  --header "Accept: */*" \
  --request POST \
  --data '{ "api_key": "LET ME KNOW IF YOU NEED THIS", "events": [ { "user_id": "datamonster@gmail.com", "device_id": "C8F9E604-F01A-4BD9-95C6-8E5357DF265D", "event_type": "watch_tutorial", "time": 1622783058 } ] }' \
  https://api2.amplitude.com/2/httpapi

this succeeds and the event count does implement.

if it's helpful, the client is Carbon Health and the project is SGP Test.

thanks in advance!

sgpennebaker

comment created time in 4 days

delete branch amplitude/Amplitude-Java

delete branch : pom-maven

delete time in 4 days

issue commentamplitude/Amplitude-Java

Trying to create a simple Java example

awesome - and i apologize, other projects interfered so i am just getting back to this today. so our timing is perfect ;)

sgpennebaker

comment created time in 4 days

issue closedamplitude/Amplitude-Java

Trying to create a simple Java example

Trying to create a simple Java example

package com.carbon.amplitude;

import com.amplitude.Amplitude;
import com.amplitude.Event;

public class AmplitudeSend {

    public static void main( String[] args ) {

        System.out.println( "Hello World!" );

        Amplitude amplitude = Amplitude.getInstance( "WHAT_SHOULD_THIS_BE");
        amplitude.init("I_DO_HAVE_THE_API_KEY" );

        amplitude.logEvent( new Event("ButtonClicked", "test_user_id" ) );
    }
}

Can't figure out what the instance should be. I do have an API key which is in the code. The test project has a project id and a secret key if that helps any.

        Amplitude amplitude = Amplitude.getInstance();

No argument is in the quickstart but that's not legal.

So: what should the instance name be? can that be clarified in the quickstart? can the no argument getInstance() be taken out of the quickstart?

Thanks!

closed time in 4 days

sgpennebaker

issue commentamplitude/Amplitude-Java

Trying to create a simple Java example

Hello @sgpennebaker ,

My bad. I just realized this method getInstance() is not available in the first version of the Java SDK. getInstance() is the equivalent of getInstance(""). No string or an empty string represents the default instance. Please update the Java SDK to version 1.2.0 and the quick start should work. Thank you for helping us improve our API. If there's any more questions please reopen this ticket or create a new one.

Dante

sgpennebaker

comment created time in 4 days

issue closedamplitude/Amplitude-Java

ETA for coming out of Beta?

Summary

Hi, Our team is thinking about using this, any idea when this will make it out of beta? and is there any known issues at the moment?

Thanks! <!-- What do you need help with? -->

closed time in 4 days

jamesjjq-altway

issue commentamplitude/Amplitude-Java

ETA for coming out of Beta?

V1.2.0 GA of the Java SDK has been released. Thank you @jamesjjq-altway for your consideration of the Java SDK. If you would like, please provide us with your use case for the Java SDK. We are always interested in new features that customers need.

jamesjjq-altway

comment created time in 4 days

created tagamplitude/Amplitude-Java

tagv1.2.0

created time in 4 days

delete branch amplitude/Amplitude-Java

delete branch : javadoc

delete time in 4 days

push eventamplitude/Amplitude-Java

Dante Tam

commit sha 4c9d3a94d2ecb1e80ab12a8b1593d418ac3282d5

Add Javadocs for documentation of all public facing methods and class variables (#14) * Add Javadocs for documentation of all public facing methods and class variables * Change version number for next release, space out and fix Javadocs * Add comment to legacy SDK API * Add group properties documentation

view details

push time in 4 days

PR merged amplitude/Amplitude-Java

Add Javadocs for documentation of all public facing methods and class variables

Will do the release right after this is approved

+183 -4

0 comment

6 changed files

dantetam

pr closed time in 4 days

push eventamplitude/Amplitude-Java

Dante Tam

commit sha 742fd9c28e85570a05e3c7c23675671b2b102160

Add group properties documentation

view details

push time in 5 days

Pull request review commentamplitude/Amplitude-Java

Add Javadocs for documentation of all public facing methods and class variables

  public class Event { +  /** A unique identifier for your event. */   public String eventType;++  /**+   * A readable ID specified by you. Must have a minimum length of 5 characters. Required unless+   * device_id is present.+   */   public String userId;++  /**+   * A device-specific identifier, such as the Identifier for Vendor on iOS. Required unless user_id+   * is present. If a device_id is not sent with the event, it will be set to a hashed version of+   * the user_id.+   */   public String deviceId; +  /**+   * The timestamp of the event in milliseconds since epoch. If time is not sent with the event, it+   * will be set to the request upload time.+   */   public long timestamp = System.currentTimeMillis();++  /** The current Latitude of the user. */   public double locationLat;++  /** The current Longitude of the user. */   public double locationLng; +  /** The current version of your application. */   public String appVersion;++  /** Legacy SDK API, only for use with older API. The application's version name. */   public String versionName; +  /** Platform of the device. */   public String platform;++  /** The name of the mobile operating system or browser that the user is using. */   public String osName;++  /** The device brand that the user is using. */   public String deviceBrand;++  /** The device manufacturer that the user is using. */   public String deviceManufacturer;++  /** The device model that the user is using. */   public String deviceModel;++  /** The carrier that the user is using. */   public String carrier; +  /** The current country of the user. */   public String country;++  /** The current region of the user. */   public String region;++  /** The current city of the user. */   public String city;++  /** The current Designated Market Area of the user. */   public String dma; +  /** (iOS) Identifier for Advertiser. */   public String idfa;++  /** (iOS) Identifier for Vendor. */   public String idfv;++  /** (Android) Google Play Services advertising ID */   public String adid;++  /** (Android) Android ID (not the advertising ID) */   public String androidId; +  /** The (human) language set by the user. */   public String language;++  /**+   * The IP address of the user. Use "$remote" to use the IP address on the upload request. We will+   * use the IP address to reverse lookup a user's location (city, country, region, and DMA).+   * Amplitude has the ability to drop the location and IP address from events once it reaches our+   * servers. You can submit a request to our platform specialist team here to configure this for+   * you.+   */   public String ip;++  /**+   * A dictionary of key-value pairs that represent additional data to be sent along with the event.+   * You can store property values in an array. Date values are transformed into string values.+   * Object depth may not exceed 40 layers.+   */   public JSONObject eventProperties;++  /**+   * A dictionary of key-value pairs that represent additional data tied to the user. You can store+   * property values in an array. Date values are transformed into string values. Object depth may+   * not exceed 40 layers.+   */   public JSONObject userProperties; +  /**+   * The price of the item purchased. Required for revenue data if the revenue field is not sent.+   * You can use negative values to indicate refunds.+   */   public double price;++  /** The quantity of the item purchased. Defaults to 1 if not specified. */   public int quantity;++  /**+   * revenue = price * quantity. If you send all 3 fields of price, quantity, and revenue, then+   * (price * quantity) will be used as the revenue value. You can use negative values to indicate+   * refunds.+   */   public double revenue;++  /**+   * An identifier for the item purchased. You must send a price and quantity or revenue with this+   * field.+   */   public int productId;++  /**+   * The type of revenue for the item purchased. You must send a price and quantity or revenue with+   * this field.+   */   public String revenueType; +  /**+   * An incrementing counter to distinguish events with the same user_id and timestamp from each+   * other. We recommend you send an event_id, increasing over time, especially if you expect events+   * to occur simultanenously.+   */   public int eventId;++  /**+   * The start time of the session in milliseconds since epoch (Unix Timestamp), necessary if you+   * want to associate events with a particular system. A session_id of -1 is the same as no+   * session_id specified.+   */   public int sessionId;++  /**+   * A unique identifier for the event. We will deduplicate subsequent events sent with an insert_id+   * we have already seen before within the past 7 days. We recommend generation a UUID or using+   * some combination of device_id, user_id, event_type, event_id, and time.+   */   public String insertId = UUID.randomUUID().toString(); +  /**+   * This feature is only available to Enterprise customers who have purchased the Accounts add-on.+   * This field adds a dictionary of key-value pairs that represent groups of users to the event as+   * an event-level group. You can only track up to 5 groups.+   */   public JSONObject groups;+

nit: do we need docs for groupProperties?

dantetam

comment created time in 5 days

push eventamplitude/Amplitude-Java

Dante Tam

commit sha d73f9f23897d3a9ed8990e3924f5b307628f9051

Add comment to legacy SDK API

view details

push time in 5 days

Pull request review commentamplitude/Amplitude-Java

Add Javadocs for documentation of all public facing methods and class variables

  public class Event { +  /** A unique identifier for your event. */   public String eventType;+  /**+   * A readable ID specified by you. Must have a minimum length of 5 characters. Required unless+   * device_id is present.+   */   public String userId;+  /**+   * A device-specific identifier, such as the Identifier for Vendor on iOS. Required unless user_id+   * is present. If a device_id is not sent with the event, it will be set to a hashed version of+   * the user_id.+   */   public String deviceId; +  /**+   * The timestamp of the event in milliseconds since epoch. If time is not sent with the event, it+   * will be set to the request upload time.+   */   public long timestamp = System.currentTimeMillis();+  /** The current Latitude of the user. */   public double locationLat;+  /** The current Longitude of the user. */   public double locationLng; +  /** The current version of your application. */   public String appVersion;+

Just discuss this with @kelvin-lu, since this also exists in node js sdk. The version name does not exist in current http v2 documents, so that's might be the legacy code.

dantetam

comment created time in 5 days

Pull request review commentamplitude/Amplitude-Java

Add Javadocs for documentation of all public facing methods and class variables

  public class Event { +  /** A unique identifier for your event. */   public String eventType;

Ran the formatter. No spaces needed from them, but I decided to add the spaces for better readability.

Later on, customers will use the Javadocs to figure out which fields of Event to set.

dantetam

comment created time in 5 days

push eventamplitude/Amplitude-Java

Dante Tam

commit sha a66b564bd859553f87b43c47cdddef3bc181d458

Change version number for next release, space out and fix Javadocs

view details

push time in 5 days

Pull request review commentamplitude/Amplitude-Java

Add Javadocs for documentation of all public facing methods and class variables

  public class Event { +  /** A unique identifier for your event. */   public String eventType;+  /**+   * A readable ID specified by you. Must have a minimum length of 5 characters. Required unless+   * device_id is present.+   */   public String userId;+  /**+   * A device-specific identifier, such as the Identifier for Vendor on iOS. Required unless user_id+   * is present. If a device_id is not sent with the event, it will be set to a hashed version of+   * the user_id.+   */   public String deviceId; +  /**+   * The timestamp of the event in milliseconds since epoch. If time is not sent with the event, it+   * will be set to the request upload time.+   */   public long timestamp = System.currentTimeMillis();+  /** The current Latitude of the user. */   public double locationLat;+  /** The current Longitude of the user. */   public double locationLng; +  /** The current version of your application. */   public String appVersion;+   public String versionName; +  /** Platform of the device. */   public String platform;+  /** The name of the mobile operating system or browser that the user is using. */   public String osName;+  /** The device brand that the user is using. */   public String deviceBrand;+  /** The device manufacturer that the user is using. */   public String deviceManufacturer;+  /** The device model that the user is using. */   public String deviceModel;+  /** The carrier that the user is using. */   public String carrier; +  /** The current country of the user. */   public String country;+  /** The current region of the user. */   public String region;+  /** The current city of the user. */   public String city;+  /** The current Designated Market Area of the user. */   public String dma; +  /** (iOS) Identifier for Advertiser. */   public String idfa;+  /** (iOS) Identifier for Vendor. */   public String idfv;+  /** (Android) Google Play Services advertising ID */   public String adid;+  /** (Android) Android ID (not the advertising ID) */   public String androidId;-+  /** The (human) language set by the user. */   public String language;+  /**+   * The IP address of the user. Use "$remote" to use the IP address on the upload request. We will+   * use the IP address to reverse lookup a user's location (city, country, region, and DMA).+   * Amplitude has the ability to drop the location and IP address from events once it reaches our+   * servers. You can submit a request to our platform specialist team here to configure this for+   * you.+   */   public String ip;+  /**+   * A dictionary of key-value pairs that represent additional data to be sent along with the event.+   * You can store property values in an array. Date values are transformed into string values.+   * Object depth may not exceed 40 layers.+   */   public JSONObject eventProperties;+  /**+   * A dictionary of key-value pairs that represent additional data tied to the user. You can store+   * property values in an array. Date values are transformed into string values. Object depth may+   * not exceed 40 layers.+   */   public JSONObject userProperties; +  /**+   * The price of the item purchased. Required for revenue data if the revenue field is not sent.+   * You can use negative values to indicate refunds.+   */   public double price;+  /** The quantity of the item purchased. Defaults to 1 if not specified. */   public int quantity;+  /**+   * revenue = price quantity. If you send all 3 fields of price, quantity, and revenue, then (price

Good catch. Appears to be a typo on the HTTP V2 API as well. Will alert the team

dantetam

comment created time in 5 days