API mappings from Android to Windows
We provide an API mapping index to help you find Android API equivalents to the Windows Runtime APIs so that you can jumpstart your development projects for Windows 8.
You can use your existing Android skills and code assets to develop highly differentiated Windows Store apps. To ease the transition to Windows Store apps for Android developers, we have provided an API mapping index. The index maps Android APIs to corresponding Windows Runtime APIs with similar functionality.
While this topic focuses on Windows Runtime API mappings, we also provide additional resources to help your transition to Windows Store apps development, including:
If you're an Android developer, the API mapping index can orient you and help you find your way around the Windows Runtime development platform. It helps you evaluate your existing apps, pick out the Windows Runtime API calls that are most important, and quickly look up the equivalent Windows Runtime classes, methods, and properties.
The API mappings provide:
- Assistance to Android developers who are creating their first Windows Store apps from scratch. In this case, the index provides mental mappings so that you can investigate features and ideas that you're already familiar with from Android.
- Porting assistance for existing Android apps by mapping specific functionality between the two platforms. Of course, porting your app is rarely good enough. You should familiarize yourself with the guidelines and principles of great Windows Store app design in order to make a great Windows Store app that will stand out from the crowd.
If there is a Windows Runtime API that has similar functionality to an Android API equivalent, the index provides a mapping. The mapping includes links to the Windows Runtime API reference documentation and code snippets that demonstrate usage, when available. If no direct mapping is possible, the index provides a link to the closest conceptual topic, so that you can better understand the conceptual mappings between the platforms. The conceptual topic is a starting point for further investigation.
The API mapping index doesn't provide complete coverage for every feature or API available in Android. The API mappings provide partial coverage for some of the most popular and important framework from Android. This includes frameworks related to controls, sensors, networking, graphics, and media, including audio and video. Other frameworks may be added in the future.
Because of differences in the design of Android and the Windows Runtime, it is not always possible to map one API to another. Often the same functionality can be implemented using a combination of Windows Runtime APIs and code. The index doesn't include mappings in those cases.
The index is not a migration tool, in that it won't automatically evaluate your code and port it to work with Windows 8. The API mappings are intended to help you narrow your search for related APIs. Starting with the mapped APIs, you should identify how to implement corresponding functionality to take advantage of the Windows 8 platform to build your app.
To use the API mapping index, select an Android package on the left-hand side. Then select the class or interface and method or other member. If the index includes a mapping, it shows the corresponding Windows Runtime APIs class and method or other member on the right-hand side. The index lets you browse all mappings or search for specific mappings. Here are some examples:
- A developer wants to look for a Windows Runtime API that provides similar functionality to the Android Camera class. The developer knows that the Camera class belongs to the android.hardware package. He or she clicks android.hardware on the left-hand side and then clicks Camera. On the right-hand side, a link to the Windows Runtime MediaCapture class API reference topic appears, along with a link to a MediaCapture class code sample.
- A developer wants to look for a Windows Runtime API that provides similar functionality to the Android File class's getPath method. The developer knows that the File class belongs to the java.io package. He or she clicks java.io on the left-hand side, then File, then Methods, then getPath. On the right-hand side, links to the Windows Runtime StorageFile, FileInformation, and FolderInformation class API reference topics appear.
- A developer wants to look for a Windows Runtime API that provides similar functionality to the Android Sensor class. He or she types Sensor in the Search... box and then clicks the magnifying glass icon. A list of Windows Runtime API search results appears. The developer clicks on one of the search results, and a link to an equivalent Windows Runtime API reference topic appears.
At times, multiple Windows Runtime API mappings are possible for a given Android API. In this case, the API mapping index shows all possible mappings. If your search returns multiple mappings, you'll need to review the corresponding API reference topics to identify the most appropriate Windows Runtime API for your use.
The Windows Runtime is a versatile development platform. You can almost always implement the functionality found in a given Android app that you wish to implement or to port. However, due to differences in programming models, there may not be an exact Windows Runtime API that corresponds to a given Android API. Due to differences in programming abstractions, functionality similar to an Android API may have to be implemented using more than one Windows Runtime API or by creating your own custom class or method. Where mapping to a single Windows Runtime API is not possible, the API mapping index provides a pointer to a conceptual topic that explains the corresponding platform functionality.
Now that you know what the index can do for you, we invite you to give it a try. We also invite you to help us extend our platform coverage, as our API mappings are a work in progress. If you identify a new API mapping that doesn't yet exist in the index, please take a few moments to let us know. To do this, in the API mapping index, below the Search... box, click Something missing? Suggest a new mapping, and follow the on-screen directions. We'll review your suggestions, and if appropriate, we'll add them to the database.