Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Sometimes, in order to study the system better, you want to dive into the code as fast as possible. To make this easier, Aspose.Words provides different plans for purchase or offers a Free Trial and a 30-day Temporary License for evaluation.
Aspose.Words is incredible software that developers can try before purchasing. You can easily download/install Aspose.Words for Java and Aspose.Words for Android via Java from the download page for evaluation.
The evaluation version is the same as the purchased one – the Trial version simply becomes licensed when you add a few lines of code to apply the license.
After purchase, you need to apply the license file or include the license file as an embedded resource. This section describes options of how this can be done, and also comments on some common questions.
A license is a plain text XML file that contains details such as product name, number of developers licensed, subscription expiry date, and so on.
The file is digitally signed, so do not modify the file. Even inadvertent addition of an extra line break into the file will invalidate it.
You need to set the license:
After purchasing a license, you need to carefully read the information on page Protecting Your Purchased License to protect your license file. Please note that this page is available for viewing only if you have a paid license.
Licenses can be applied from various locations:
In Aspose.Words for Android via Java, the license can be embedded as a resource, or loaded from a stream:
SetLicense
method.Java
String dataDir = Environment.getExternalStorageDirectory().getPath() + "/";
// Create a stream object containing the license file
FileInputStream fstream = new FileInputStream(dataDir + "Aspose.Email.Android.Java.lic");
// Instantiate the `License` class
License license = new License();
//Set the license through the stream object
license.setLicense(fstream);
Applying a License from an Embedded Resource. To access the license as a resource by name from an Android package file:
Java
License license = new License();
InputStream inputStream = getResources().openRawResource(R.raw.license);
license.setLicense(inputStream);
Aspose.Words allows developers to to apply metered key. It is a new licensing mechanism. The new licensing mechanism will be used along with existing licensing method. Those customers who want to be billed based on the usage of the API features can use the metered licensing.
Java
Metered metered = new Metered();
try
{
// Access the setMeteredKey property and pass public and private keys as parameters
metered.setMeteredKey(publicKey, privateKey);
Log.i("Metered License", "Ok. Metered License has been applied successfully.");
}
catch (Exception ex)
{
ex.printStackTrace();
Log.e("Metered License", "Setting metered key has failed: " + ex.getMessage());
}
The license file name does not have to be ‘Aspose.Words.Android.Java.lic’. You can rename it to anything you like and use that name when calling License.SetLicense
.
When you download a license you’ve bought, the license file is named Aspose.Words.Android.Java.lic by default. The license file is downloaded through your browser and some browsers recognize the license file as XML and append an .xml extension to the name. The downloaded file becomes Aspose.Words.Android.Java.lic.XML.
When Microsoft Windows is configured to hide extensions of known file types (unfortunately this is default in most Windows installations), the license file is listed as Aspose.Words.Android.Java.lic in Windows Explorer. It looks like the expected file name. If you call License.SetLicense
and pass ‘Aspose.Words.Android.Java.lic’, you’ll see and exception because there is no such file.
To solve the problem, rename the file to remove the invisible .xml extension. We recommend that you disable the “hide extensions” option in Microsoft Windows.
If you use several Aspose products in an application, for example Aspose.Words and Aspose.Cells
, here are a few useful tips.
License.SetLicense
method separately for each Aspose product.License
class in its namespace. For example, Aspose.Words has com.aspose.words.License and Aspose.Cells
has com.aspose.cells.License class. Using the fullyqualified class name allows you to avoid any confusion about which license is applied to which product.Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.