Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Transitioning to x64 Architecture in Android

  • Last Updated : 08 Sep, 2021

If your app solely utilizes code written in Java or Kotlin, including any libraries or SDKs, it is already ready for 64-bit devices. If your app utilizes native code, or if you are unclear whether it does, you must evaluate it and take action.

But why are we actually transitioning?

Google plans to transition to a 64-bit app ecosystem in the next years in order to provide a superior software experience on devices powered by 64-bit CPUs. The firm has recently provided further information about the change, stating that beginning in August of this year, developers would be required to submit a 64-bit version of their Android apps. This step will eventually lead to the worldwide application of the 64-bit app policy, which will be implemented in 2021, after which Google will no longer host 32-bit apps on the Play Store when accessed via a device with 64-bit hardware.

But how can we know whether we have. as well as extension files:

You must examine your app’s APK in Android Studio’s APK Analyzer. To launch APK Analyzer:

  1. Pick Build > Analyze APK from the menu, and then select the APK to be evaluated.
  2. Now, if you check in the analyzer to the lib folder and notice any.
  3. So you have 32-bit libraries if you have any armeabi-v7a or x86, or 32-bit libraries if you have any armeabi-v7a or x86.
  4. If you don’t notice any .so files, your program doesn’t need to be upgraded.

The Conversion of 32-bit code to 64-bit code

If your code already works on the desktop or iOS, you shouldn’t have to do anything special for Android. If this is your first time writing code for a 64-bit system, the major difficulty you’ll have to deal with is that references no longer fit in 32-bit integer types like int. You will need to change the code that saves pointers in int, unsigned, or uint32 t types. Long matches the pointer size on Unix platforms, but not on Windows, therefore use the intention-revealing types uintptr t or intptrt instead. To hold the difference between two pointers, use the ptrdiff t type.

By unzipping APKs, you may look for native libraries:

APK files are organized similarly to zip files and maybe extracted similarly. Unzipping the APK will work if you want to use the command line or another extraction tool. Simply unzip the APK file (depending on your extraction program, you may need to rename it to.zip) and explore the extracted contents, following the instructions above to determine if you are ready for 64-bit devices.

Is there some exception for my app?

Google Play will continue to deliver 32-bit upgrades for games created with the Unity 5.6 development environment or an earlier version. This, however, will only last until August 1, 2021. Furthermore, APKs and software bundles created for the Wear OS and Android TV platforms that do not support 64-bit code will be excluded from the prohibition. Finally, any applications and package kits for Google’s mobile operating system that are not intended for devices running Android Pie or a later version will be exempt from the 64-bit-only restriction.

Create your program using 64-bit libraries

The steps below will guide you through the process of creating 64-bit libraries. However, you should be aware that this only applies to building code and libraries that can be built from the source.

GeekTip: If you’re using any third-party SDKs or libraries, make sure you’re utilizing 64-bit versions by following the procedures outlined above. If a 64-bit version is not available, contact the SDK or library owner and keep this in mind while planning your support for 64-bit devices.

Do this to convert your current app to x64:

:: Command Line of your choice
> cmake -DANDROID_ABI=arm64-v8a … or
> cmake -DANDROID_ABI=x86_64 …

Devices that are just 64-bit will be available in 2023

Arm’s message to the developer community is to begin the shift to solely 64-bit programming as soon as possible. The advantages far exceed the disadvantages. A 64-bit processor can handle more data at once, allowing new and emerging mobile technologies to thrive. 64-bit CPUs can collect, transfer, and process bigger chunks of data in less time than 32-bit CPUs, resulting in higher performance—improvements of up to 20% for specific workloads. This means that 64-bit devices are typically quicker and more responsive (though this is also dependent on well-written code).

Conclusion

The transition to 64-bit Android is a win-win situation for everyone. It will bring a variety of performance, efficiency, and security advantages to the whole Android ecosystem without creating major disruption, while also preparing developers for future mobile innovation. As a consequence, we are highly supportive of the transition and remain confident that developers all around the world will be able to migrate their programs to 64-bit.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!