This Hello World project shows how to:
- Connect to the SPHERE.IO API with OAuth2
- Search and sort products
- Create a cart
- Put a product into a cart
git clone
this repo
git clone git@github.com:sphereio/commercetools-android-example.git
- If you don't have a SPHERE.IO project yet, register at the Merchant Center and setup a project. If you add sample data, the app will work with that out of the box!
- In the Merchant Center, go to the
Developers
section and selectAPI Clients
- Copy
credentials.xml.template
tocredentials.xml
cp commercetools-android-example/app/src/main/res/values/credentials.xml.template
commercetools-android-example/app/src/main/res/values/credentials.xml
- Uncomment the keys and enter your credentials
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="project">your-project-name</string>
<string name="clientId">your-client-id</string>
<string name="clientSecret">your-client-secret</string>
</resources>
- Now you can open the project in Android Studio and play around with it ;)