[Samsung Gear Fit] michi8c:
Fatal Exception

Hey all,

First, thanks for this sdk ;)

I've a problem, i can't even create a simple Hello World.

First, here are my Files:

MainActivity.java:

package com.example.michi.test3;

import android.app.Activity;
import android.os.Bundle;

import com.samsung.android.sdk.SsdkUnsupportedException;
import com.samsung.android.sdk.cup.Scup;

public class MainActivity extends Activity {

private testDialog testDialog = null;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Scup scup = new Scup();
try {
scup.initialize(getApplicationContext());
} catch (SsdkUnsupportedException e){
System.out.println("SsdkUnsEx: "+e.getType());
}
System.out.println("versionCode: "+scup.getVersionCode());
System.out.println("versionName: "+scup.getVersionName());

if(testDialog==null){
testDialog = new testDialog(getApplicationContext());
}else{
testDialog.finish();
testDialog=null;
}
}
}

AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="urlCausesProblems..NewUser ;)"
package="com.example.michi.test3">

<uses-permission android:name="com.samsung.android.sdk.permission.SAMSUNG_CUP_SERVICE"/>
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY"/>

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<meta-data
android:name="SAMSUNG_CUP_APP"
android:value="Test3;ic_launcher;true" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="com.samsung.android.sdk.cup" />
</intent-filter>
</activity>
</application>

</manifest>

testDialog.java:

package com.example.michi.test3;

import android.content.Context;

import com.samsung.android.sdk.cup.ScupDialog;

/**
* Created by Michi on 18.02.2016.
*/
public class testDialog extends ScupDialog {

public testDialog(Context context)
{
super(context);
}

@Override
protected void onCreate() {
super.onCreate();
}
}

I'm using AndroidStudio for coding and my Galaxy S5 with the Gear Fit.

When I execute the code, i get a FATAL EXEPTION: main.

Here's the log:

le.michi.test3 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.michi.test3, PID: 28877
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.michi.test3/com.example.michi.test3.MainActivity}: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.samsung.android.sdk.cup.ScupService }
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2658)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2723)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5832)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.samsung.android.sdk.cup.ScupService }
at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1982)
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:2090)
at android.app.ContextImpl.bindService(ContextImpl.java:2068)
at android.content.ContextWrapper.bindService(ContextWrapper.java:559)
at com.samsung.android.sdk.cup.ScupServiceCommunicator.connect(Unknown Source)
at com.samsung.android.sdk.cup.ScupDialog.construction(Unknown Source)
at com.samsung.android.sdk.cup.ScupDialog.<init>(Unknown Source)
at com.example.michi.test3.testDialog.<init>(testDialog.java:14)
at com.example.michi.test3.MainActivity.onCreate(MainActivity.java:28)
at android.app.Activity.performCreate(Activity.java:6221)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2611)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2723)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5832)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

The Exception occurs in "testDialog.java" in the constructor when building it (testDialog = new testDialog(Context)).

Can anyone help me?

Greetz from Germany

Michi