Posts about Android

Xamarin Android package name in build config

January 27th 2023 Xamarin Android

The identity of an Android application consists of its package name, its label, and its icon. In a Xamarin.Forms Android application, these are specified in the AndroidManifest.xml file and as an attribute on the MainActivity class. So how would you create a build configuration with a different value for these three properties? For example, if you are creating a white-label application.

Xamarin Android 12 project build in App Center

December 30th 2022 App Center Xamarin Android

When I tried to build my Xamarin.Forms app for Android in App Center with my existing build configuration, it failed. This was odd, as the project could be built on my local machine without any problems.

Awaiting Google Play services tasks

April 16th 2021 Xamarin Android Async C#

Thanks to Xamarin, C# developers can use a lot of their existing knowledge even when interacting with native Android (and iOS) APIs. However, some APIs still break the idioms we're used to in .NET. When I recently had to integrate Firebase Cloud Messaging into a Xamarin application, I encountered an asynchronous call that couldn't be awaited. The method even returned a Task. It just wasn't the right Task.

Customizing Android Back Button in Ionic 4

November 22nd 2019 Ionic 4+ Android

Android hardware back button is something one can easily forget about but must in the end be properly supported in any mobile application. Unfortunately, built-in support in Ionic 4 is less than perfect. Many scenarios are still not properly supported as documented in a GitHub issue which hasn't been resolved for almost a year.

Issues with Initializing a New Ionic 4 Android App

February 22nd 2019 Ionic 4+ Cordova Android

The final release of Ionic 4 is a good incentive for migrating existing Ionic 2/3 applications to Ionic 4. The official documentation lists the required steps for creating a new Ionic 4 project and adding Android support to it. If you're using Cordova 8+, then the application will run fine. But if you're still using Cordova 7.1.0, you'll only be greeted by a white screen when the application starts.

Cordova 6 Bug with Plugin Variables in Gradle

August 10th 2018 Cordova Android

Cordova plugins can use variables for project specific values which must be entered when installing them. When these variables are used in Gradle build files for Android, a bug in Cordova 6.5.0 can cause the build to fail.

Viewing Console Log from an Android Device

June 15th 2018 Ionic 2/3 Android Cordova

In a previous blogpost, I've described how to intercept console log output when the application is running on the device, so that it can later be exported using the standard sharing functionality. Although this is usually the most convenient approach for testers, it's an overkill during development. In such a scenario, it's more effective to look at the console output from the debugger.

Customizing Android Manifest in Cordova

November 17th 2017 Cordova Android

Cordova has well documented support for modifying the contents of AndroidManifest.xml file from a plugin by adding config-file and edit-config elements to its plugin.xml file. It's less obvious that these same configuration elements can also be used directly inside the application's config.xml.

Specifying Android SDK Version in Cordova

November 10th 2017 Cordova Android

In native Android applications, the version of build tools and SDK to build them with can be specified directly in the Gradle build script. In Cordova applications, the build file is automatically generated, therefore any manual changes to it will be overwritten. The question is, where do the values in the generated file come from.

Handling Hardware Back Button in Ionic

September 29th 2017 Ionic 2/3 Android

Ionic applications have built-in support for Android's hardware back button. For the root page it closes the application by default. There are ways to change that behavior, though.

Breaking Changes in Android SDK 26

July 21st 2017 Android Cordova Ionic 2/3

I have finally updated Android SDK to the latest version, because I wanted Android Studio to stop informing me about available updates on every startup. Unfortunately several breaking changes have been introduced since the version I was using before, which altogether broke my regular flow of work.

Proguard Configuration in Cordova

July 14th 2017 Proguard Cordova Android

Proguard is an optimizer and obfuscator for Java code. It can easily be enabled with only a few entries in the Gradle build script. In Cordova applications, the build script is regenerated on each build, therefore you'll need a plugin to add the required entries to it unless you want modify it by hand every time.

Extending Cordova Google Maps Plugin

July 7th 2017 Cordova Google Maps Android

While you could use Google Maps JavaScript API in Cordova hybrid mobile applications, native Google Maps SDKs for Android and iOS offer much better user experience. There is a plugin available, to use them from Cordova. It even has an undocumented extensibility model.

Debug Ionic 2 Apps in VS Emulator for Android

The official Android emulator has a big disadvantage for regular users of Hyper-V: you cannot run the emulator accelerated when Hyper-V is enabled. Fortunately, there is an alternative: Visual Studio Emulator for Android, which uses Hyper-V for hardware acceleration.

Book Review: Xamarin Mobile Application Development for Android

April 27th 2014 Xamarin Android Review Book

The book is a great first step into the world of Xamarin.Android for a seasoned .NET C# developer with no previous development experience on Android. It's definitely enough to get you started and makes it much easier to decide whether this is the right way to build Android applications or not.