OpenCMIS Android Client ======================= The OpenCMIS Android Client provides a collection of methods to access and manage CMIS Repository. OpenCMIS Client Bindings supported ---------------------------------- OpenCMIS Android Client supports the AtomPub Binding and the Browser Binding. The Web Service Binding (SOAP protocol) is not supported by this library. Android Version Supported ------------------------- Previous versions of Android don't contain all dependencies required to run and use OpenCMIS Android client. It's only since Android 2.3 (aka Gingerbread) everything works. In other terms, Android client supports Android 2.3 and above. ------------------------- !!! IMPORTANT NOTE !!! ------------------------- OpenCMIS Android Client is a SYNCHRONOUS library ! It's highly recommended that you encapsulate all CMIS operations in background thread. In Android it's possible to use + Services + Loaders + AsyncTask + Thread/Handler For more information on Thread and background task : Importing the Android OpenCMIS Client into your Android Project --------------------------------------------------------------- The Android OpenCMIS Client requires SLF4J for android. Download it from here: Put the Android OpenCMIS Client Jar and SLF4J jar into your Android project libs folder. Now you're ready to use OpenCMIS inside your project. For more information on Project libs folder : Importing the Android OpenCMIS Client with Maven ------------------------------------------------ If you use Maven to build your Android Project, it's possible to add this library as Maven dependency. Add to your pom project : ... com.google.android annotations org.apache.chemistry.opencmis chemistry-opencmis-android-client x.z.y org.slf4j slf4j-api org.slf4j slf4j-android 1.7.5 ... Code sample ----------- This code sample illustrates how to display in a simple TextView a list of folder children. public class FirstOpenCMISActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); new FirstOpenCMISAsyncTask().execute(); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true; } private class FirstOpenCMISAsyncTask extends AsyncTask { @Override protected String doInBackground(Void... arg0) { SessionFactory sessionFactory = SessionFactoryImpl.newInstance(); Map parameter = new HashMap(); parameter.put(SessionParameter.USER, "admin"); parameter.put(SessionParameter.PASSWORD, "admin"); parameter.put(SessionParameter.ATOMPUB_URL, "http://192.168.1.100:8080/inmemory/atom/"); parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value()); Repository repository = sessionFactory.getRepositories(parameter).get(0); parameter.put(SessionParameter.REPOSITORY_ID, repository.getId()); Session session = sessionFactory.createSession(parameter); String listChildren = ""; Folder mediaFolder = (Folder) session.getObjectByPath("/media"); ItemIterable children = mediaFolder.getChildren(); for (CmisObject o : children) { listChildren += o.getName() + " - " + o.getType().getDisplayName() + " - " + o.getCreatedBy() + "\b\n"; } return listChildren; } @Override protected void onPostExecute(String result) { TextView tv = (TextView) (FirstOpenCMISActivity.this).findViewById(R.id.opencmis_text); tv.setText(result); } } }