Basic Kaa mobile application with android sdk

2019-09-14 23:41发布

问题:

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

回答1:

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.



回答2:

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



标签: kaa