More in this section

Android SDK Microsoft.NET SDK

Software Development Kit for Android

  1. Download the cloud4apps library from the following link:
    https://sourceforge.net/projects/cloud4apps/files/
  2. Extract the zip file to your working directory
  3. Import the cloud4apps library and sample app from Eclipse
  4. Create a new Android project or open your existing project
  5. In the Package Explorer, right-click your project and select Properties.
  6. In the Properties window, select the "Android" properties group at left and locate the Library properties at right.
  7. Click Add to open the Project Selection dialog.
  8. From the list of available library projects, select cloud4apps.SDK and click OK.

Using The Translation Services

  1. Navigate to your apps
  2. Find the App Version you want to consume resources from and click on it
  3. Copy the [Version Key] and paste it into a constant in your code as shown below:

    // Edit these values from:
    // https://www.cloud4apps.com/Translation/Translate?versionKey=your_app_version_here&targetLanguageCode=en
    String versionKey = "your_app_version_here";
    TextView text2 = (TextView) this.findViewById(R.id.text2);
    String helloCloud = cloud4apps.Localize.ResourceUtils.getString(this, versionKey, R.string.helloCloud);
    text2.setText(helloCloud);

Consuming the Payments & Licensing System:

  1. Navigate to your apps
  2. Find the App Version you want to consume resources from and click on it to obtain the [App Key]
  3. Add the following line to the Purchase or Upgrade OnClickListener function:

    private OnClickListener buttonBuy = new OnClickListener() {
       public void onClick(View v) {
          String appKey= "[Enter Here the App Key from previous step]";
          String clientId = cloud4apps.Utils.GetClientId(context);
          String email = cloud4apps.Utils.GetEmail(context);
          cloud4apps.LicenseServices.Purchase(Main.this, appKey, clientId, email);
       }
    }

  4. Navigate to your apps
  5. Click on the app version to obtain the [Version Key] for each version of your app
  6. Add the following code to check if a particular license is active

    cloud4apps.LicenseInfo lic = cloud4apps.LicenseInfo.GetActiveLicense(context, appKey, clientId);
    String versionKeyPremium = "";
    String versionKeyBasic = "";
    if (lic.VersionKey.contentEquals(versionKeyPremium)) {
       // Activate app's premium features
    } else if (lic.VersionKey.contentEquals(versionKeyBasic )) {
       // Activate app's basic features
    }


  7. Include the following permissions in your AndroidManifest.xml file:

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />

Software Development Kit for Microsoft.NET

  1. Download the cloud4apps library from the following link:
    https://sourceforge.net/projects/cloud4apps/files/
  2. Extract the zip file to your working directory
  3. Open your Microsoft.NET Solution
  4. Add the cloud4apps.SDK project

Using The Translation Services

  1. If your solution is MVC you can create a model for your view based on the following code:

    // Obtain your app version key from https://www.cloud4apps.com/Account/Apps/List
    public const string APP_VERSION_KEY = "your-key-here";
    public const string TRANSLATION_LINK = "https://www.cloud4apps.com/Translation/Translate?versionKey=" + APP_VERSION_KEY;

    public string LanguageCode { get; private set; }

    public IDictionary<string, string> Languages { get { return cloud4apps.SDK.Localize.AvailableLanguages(APP_VERSION_KEY); } }
    public cloud4apps.SDK.Localize Resources { get { return cloud4apps.SDK.Localize.Translations(APP_VERSION_KEY, LanguageCode); } }

  2. Access the language resources from your view with the following method:

    <%: Model.Resources.GetString("resource_id", "Default text") %>

    You can find more implementation details from the cloud4apps.Sample project included with the SDK