Start a new topic

Layout in NativeSDK Examples

Hello. 

I am using the example Android App (NativeSDKExamples): in particolar the class SimpleClientTrackingActivity.java, because I need to use a Marker Recognition.


I have a question:

In this Activity appears the camera on all the display. 

Can I add simple buttons on the display layout (over the camera display) and How can I modify the layout (to add View) ?


This is the onCreate() method of the Activity class:

-------------------------------------------------


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

mWikitudeSDK = new WikitudeSDK(this);
NativeStartupConfiguration startupConfiguration = new NativeStartupConfiguration();
startupConfiguration.setLicenseKey(WikitudeSDKConstants.WIKITUDE_SDK_KEY);
startupConfiguration.setCameraPosition(CameraSettings.CameraPosition.BACK);
startupConfiguration.setCameraResolution(CameraSettings.CameraResolution.AUTO);

mWikitudeSDK.onCreate(getApplicationContext(), this, startupConfiguration);

mTargetCollectionResource = mWikitudeSDK.getTrackerManager().createTargetCollectionResource("file:///android_asset/tracker.wtc", new TargetCollectionResourceLoadingCallback() {
@Override
public void onError(int errorCode, String errorMessage) {
Log.v(TAG, "Failed to load target collection resource. Reason: " + errorMessage);
}

@Override
public void onFinish() {
mWikitudeSDK.getTrackerManager().createImageTracker(mTargetCollectionResource, SimpleClientTrackingActivity.this, null);
}
});

mDropDownAlert = new DropDownAlert(this);
mDropDownAlert.setText("Scan Target #1 (surfer):");
mDropDownAlert.addImages("surfer.png");
mDropDownAlert.setTextWeight(0.5f);
mDropDownAlert.show();
}


-------------------------------------------------

Thank you very much!


Best Regards!


Hello Christian,

Yes, it is possible to add buttons on the display layout and modify it as you like. However, since you are using the Native SDK, we do not offer any examples on how to do that, since this is entirely up to the developer to program how he wishes his app to behave. The Native API wraps the main functionalities of the Wikitude computer vision engine and enables the full computer vision power in your app. To keep it lean, the Native API does not integrate a separate rendering engine, but offers you the full flexibility in terms of rendering augmented reality content.

Thanks
Eva

Thank you very much!

An other question.

To take a picture with the camera, what is the method to call?

Hi Christian,

Please refer to the example here.

Thanks
Eva

 

Login or Signup to post a comment