Basic Kaa mobile application with android sdk

2019-09-14 23:34发布

Trying to connect to Kaa Server with Android SDK :

  1. Added downloaded android sdk jar as library in application.

  2. Code public class MainActivity extends AppCompatActivity {

    private Context mContext; private KaaClient mClient;

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

    mClient = Kaa.newClient(new AndroidKaaPlatformContext(mContext), new SimpleKaaClientStateListener(){
        @Override
        public void onStarted(){
            Toast.makeText(mContext, "Success", Toast.LENGTH_LONG).show();
        }
        @Override
        public void onStartFailure(KaaException exception){
            Toast.makeText(mContext, "Failure", Toast.LENGTH_LONG).show();
        }
    },true);
    
    mClient.start();
    

    } }

But not getting Success message.

Is there any tutorial out there to follow for Android SDK ?

Regards, Hiten

标签: kaa
2条回答
一纸荒年 Trace。
2楼-- · 2019-09-14 23:58

This query is solved now. It's working as expected.

查看更多
放荡不羁爱自由
3楼-- · 2019-09-14 23:59

You have to generate SDK right base on your application and choose Target Platform is Android. And you can recheck way to add library in android studio.

查看更多
登录 后发表回答