Skip to main content

Posts

Showing posts with the label Android

Ionic Build – Gradle throws “Could not reserve enough space for object heap” error

Compiling and running an Ionic application on your Android device is a whole lot of fun, requiring a big list of tools and a little bit of good luck. It seems that I was out of luck as I got the following error message during the startup of Gradle: Could not reserve enough space for object heap To solve it, I specifically downloaded and installed the 64bit version of Java: After the installation completed, I updated my JAVA_HOME environment variable to point to the 64bit version:

The Microsoft Azure App

While getting up to date with all the great announcements at Build 2017 I noticed a small but interesting fact. It turns out that Microsoft has a mobile app (for iOS and Android ) that allows you to manage Azure from your mobile device.   From the documentation: The Microsoft Azure app helps you keep track of your resources while on-the-go: - Stay connected to the cloud and check status and critical metrics anytime, anywhere - Stay informed with notifications and alerts about important health issues - Stay in control of your resources and take corrective actions, like starting and stopping VMs and web apps Great! Now can I spin up a new VM while being stuck in traffic

Xamarin.Forms: INSTALL_FAILED_UPDATE_INCOMPATIBLE when trying to deploy to Android device

When we tried to deploy a Xamarin Forms app to an Android device, we got the following error: Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE] at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass2a.<InstallPackage>b__29(Task`1 t) at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- at Xamarin.AndroidTools.AndroidDeploySession.RunLogged(CancellationToken token) at Xamarin.AndroidTools.AndroidDeploySession.Start(CancellationToken token) The problem seemed to be that a "ghost" copy of the app still existed on the device although there was no app icon. However when searching under Applications we found it with ...

Xamarin.Forms: Error CS1703 Multiple assemblies with equivalent identity have been imported

When trying to build our Xamarin.Forms project on a VSTS hosted build server, our build failed first with the following error message: Error CS1703 Multiple assemblies with equivalent identity have been imported: ‘C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll’ and ‘C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll’. Remove one of the duplicate references. On our local system it worked without any compiler errors. We tried the easiest solution first, following the advice as mentioned in the error message. We removed the mscorlib.dll from the references. After doing that, everything was working again. I hate it when the behavior differs between a local Visual Studio Build and the build server

Creating a release pipeline for your mobile applications

I’m currently working on a release pipeline for our mobile applications, making it easy to build, deploy and test the mobile solutions we are creating on top of the Xamarin platform. Everyone who ever tried to publish a mobile application to a store(Apple AppStore, Google Play Store, Microsoft App Store,…) knows that it is cumbersome process requiring things like certificates, keystores, a lot of configuration work and so on… To optimize the process we went fully automated by using a combination of the following tools: Visual Studio Team Services Hosted Build Service MacInCloud Xamarin Test Cloud HockeyApp A great help during our journey was the DevOps blog series by Richard Woollcott: Xamarin DevOps VSTS – Getting Started: http://www.thexamarinjournal.com/xamarin-dev-ops-with-vsts-getting-started/ Xamarin DevOps with VSTS - Setup iOS CI Builds With MacinCloud: http://www.thexamarinjournal.com/xamarin-dev-ops-with-vsts-setup-ios-ci-builds-with-macinc...

Xamarin.Forms: Xamarin-Forms-Labs

The amount of controls for Xamarin.Forms is rather limited. Luckily with the help of the community and control vendors like Telerik, Syncfusion,etc… this is changing. One of the open source initiatives is Xamarin-Forms-Labs : “Xamarin Forms Labs is a open source project that aims to provide a powerful and cross platform set of controls and helpers tailored to work with Xamarin Forms” It offers a wide range of controls, services, helpers and plugins. A must have for every Xamarin.Forms developer… Available controls AutoComplete (beta) Calendar Control (beta) Checkbox (beta) DynamicListView (beta) ExtendedContentView (beta) ExtendedEntry (beta) ExtendedLabel (beta) ExtendedScrollView (IOS beta) ExtendedTabbedPage ExtendedTextCell (beta) ExtendedViewCell (beta) HybridWebView (alpha) GridView (IOS beta) ImageButton (beta) RadioButton(beta) RepeaterView (beta) SegmentedControlView (IOS beta) Web Image (beta...

Xamarin and Caliburn

This news made my week! My favorite cross-platform framework( Xamarin ) and my favorite MVVM framework( Caliburn.Micro ) are finally coming together. The team after Caliburn.Micro announced that they have a working port of Caliburn for Xamarin. Not everything is ported yet, but I expect that some of the platform specific features will be ported as well. A working sample can be found here: nigel-sampson/xamarin-experiements .

Mobile Development Platform Performance Comparison

When choosing a development platform for building Mobile applications, performance is always one of the discussion points pro- or contra a specific technology. A lot of people claim that technology X is faster than technology Y without real numbers to proof their point. I did some tests myself and had mixed experiences using Cordova, Xamarin and Native Mobile development. Last week I noticed this blog post by Kevin Ford: http://magenic.com/Blog/PostId/67/mobile-development-platform-performance . Kevin took the time to create a formal comparison between Native (Objective-C 64 bit and Java) Cordova (Multi-Device Hybrid Apps) using Intel's App Framework for the UI Classic Xamarin (64 bit unified beta for iOS) Xamarin.Forms (64 bit unified beta for iOS with beta version of Xamarin.Forms, note latest version of the unified API in the beta/alpha channels could not be used as it is not supported by Xamarin.Forms) Go check out the full post for all the details, but some things...

DevIntersection 2014 - MobiZen

At the moment I’m in Las Vegas attending DevIntersection . During the mobile development workshop I attended, the presenter was using a great tool called MobiZen . MobiZen allows you to share the screen of your Android device on your desktop or inside a web browser. You can even control your Android from your pc or laptop. This is the perfect tool not only during development but also when you want to demo some functionality to your client. And best of all, it’s free! From the documentation : Using your smartphone from your PC becomes a reality with Mobizen. Type using your keyboard, view photos and videos stored on your phone, and use mobile apps. Photo: Share your special moments on a larger screen. Music: The songs you listen to on-the-go can be enjoyed anywhere. Videos: Watch videos and movies stored on your smartphone. Files: Use drag and drop to transfer files between your smartphone and PC. This will certainly become a new tool in my m...

Building cross-platform mobile apps in Visual Studio

Interested in building cross-platform mobile apps using Visual Studio? Microsoft made this easy thanks to the Multi-Device Hybrid Apps Visual Studio extension . This extension allows you to combine Visual Studio and Apache Cordova to easily build hybrid apps that run on iOS, Android, Windows, and Windows Phone using a single project based on HTML and JavaScript. The extension is available for download here . Remark: Be aware that the extension will download and install some additional dependencies, including Joyent Node.js Git CLI Google Chrome Apache Ant Oracle Java JDK 7 Android SDK SQLLite for Windows Runtime Apple iTunes More information can be found at http://www.visualstudio.com/en-us/explore/cordova-vs.aspx .

PhoneGap/Cordova: Introducing the cross platform WebSQL plugin

Some months ago, I did an attempt to integrate SQLite in a cross platform Android, iOS and Windows Phone PhoneGap application. It was a painful experience to say the least. We encountered a lot of isssues and in the end it was way to slow. Not a good first experience with using a SQL store on a mobile device… So it makes me really happy to see that Microsoft Open Technologies published an open source WebSQL plugin for Apache Cordova and PhoneGap. This plugin allows developers to integrate a persistent SQL-based local storage solution in their Cordova apps using the exact same JavaScript code across Android, iOS, Windows Phone and Windows Store. Under the hood, the plugin is using WebSQL on iOS and Android, and the open source SQLite library on Windows devices. SQLite happens to be easily usable across Windows devices using the SQLitePCL portable Class Library published recently. The plugin can be found on the Apache Cordova plugins registry More information and the officia...

Android Emulator performance tips

The most annoying part of the whole Android development experience is the Android emulator. Even on up-to-date hardware it remains a slow beast. Here are some general tips and recommendations to improve the experience: Tip 1: Avoid the emulator at all. Test on a real device when possible. Tip 2: Keep the emulator resolution as low as possible. Tip 3: Install the Intel HAXM and use an x86 emulator image instead of an ARM one. Tip 4: Use VirtualBox as an Android emulator. Tip 5: Create a snapshot and load the emulator from this snapshot afterwards. Tip 6: Use the BlueStacks player.

Xamarin AndroidRuntimeException “Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag”

In my Android application I’m using the Azure Mobile Services component to connect to Windows Azure. I want to use the authentication component and let the users login by using their Microsoft account. Here is the code I used: However when I try to run this code, it fails the moment the LoginAsync method is called. This is the exception I get: AndroidRuntimeException “Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag” I found out that I made a stupid mistake. I was passing the BaseContext instead of the Activity itself. When I updated the code to the following it worked as expected:

Enable the keyboard in an Android emulator

After creating an Android application using the great Xamarin tools, it was finally time to do some intensive testing on the Android emulator. When starting to test I noticed something really annoying, I had to type everything through the onscreen keyboard and couldn’t use the physical keyboard on my development machine. Fixing this is easy by changing the settings of a specific emulator device: Open the AVD Manager . Select an emulator device. Click on Edit… to edit the properties of this device. The Edit AVD window is loaded. In the Hardware section, click on New.. . A list is loaded with all the properties you can configure. In the Property drop-down list, select Keyboard Support and press OK . This add the property in the hardware list. Click on the value column and change it to "yes" . Click on "Edit AVD" once again to save your changes.

Android: Install an apk file on the Android emulator

A colleague created an Android apk package using PhoneGap build and asked me to test it. But how do you get this apk file on the emulator? Start the Android emulator(through the AVD manager). Open a command prompt and navigate to the SDK\platform-tools folder. Paste the APK file in the 'platform-tools' folder. Execute the following command. adb install [apk file name]

Xamarin.Android: error when calling Azure mobile services

In a mobile application I’m building with  Xamarin Android I connect to an Azure Mobile Services backend. Xamarin made this easy by providing an Azure Mobile Services component. However when I tried to connect to Azure, every call failed with the following error message: “The authentication or decryption has failed.” I was able to fix the problem by switching to a more recent Android version in the emulator.

BlueStacks: Run all your favorite Android apps on PC and Mac

Are you interested in running all your Android apps on a PC or Mac? Try the BlueStacks App Player . (They even have an optimized version specifically build for Windows 8.)

Having a hard time selecting across-platform mobile framework? PropertyCross is here to help you.

Introduction from the website : Developers are now finding themselves having to author applications for a diverse range of mobile platforms (iOS, Android, Windows Phone, …), each of which have their own ‘native’ development languages, tools and environment. There is an ever growing list of cross-platform frameworks that allow you to minimize the cost and effort of developing mobile apps, but which to choose? To help solve this problem PropertyCross presents a non-trivial application, for searching UK property listings, developed using a range of cross-platform technologies and frameworks. Our aim is to provide developers with a practical insight into the strengths and weaknesses of each framework. This project was heavily inspired by TodoMVC , which allows the comparison of JavaScript frameworks. PropertyCross implements the same application over and over again using the following frameworks: Adobe AIR jQTouch jQuery Mobile Native RhoMobile ...

Here's why HTML-based apps don't work

I’m currently working on a cross-platform solution using Xamarin . Today a colleague sent me a link to the following article: Here's why HTML-based apps don't work . In this article Matt Baxter-Reynolds who worked on a number of different projects based on PhoneGap/Apache Cordova shares his experiences. There is one quote(and the conclusion of the article) that I want to share with you: “Go native, try Xamarin . But in terms of hybrid: avoid.” I’m just saying…