Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

MCS Storage API retrieve data

edited Apr 27, 2017 7:00AM in Digital Assistant & Mobile 1 comment

Summary

MCS Storage API retrieve data

Content

Hi,

I tried the Oracle MCS(Mobile Cloud Service) SDK in native android below.

Storage storage = (Storage) MobileBackendManager.getManager().getDefaultMobileBackend(this).getServiceProxy(Storage.class);
StorageCollection collection = storage.getStorageCollection("dbcollection");

StorageObject object = new StorageObject("ANDROID", "Hello Windows from Mobile Cloud Service".getBytes(), "plain/text");
object.setDisplayName("textFile.txt");
collection.put( object );

Everything is working fine.

Until i tried to retrieve data.

StorageObject storageObject = collection.get("ANDROID");
byte[] data = storageObject.getPayloadBytes();
Log.i("TESTING:", new String(data) );

I get the result below:

      ������������ �H���W ��K�//VH+��U��O��IUp��/MQ N-*�LN �������� ���) �'������

How to get back the content as i save in Storage Platform? 

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!