<?xml version="1.0" encoding="UTF-8"?> 
<rss version="2.0"
        xmlns:content="http://purl.org/rss/1.0/modules/content/"
        xmlns:wfw="http://wellformedweb.org/CommentAPI/"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:atom="http://www.w3.org/2005/Atom"
        xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
        xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
        >
<channel>
  <title>asgaard</title>
  <description>Ionic</description>
  <link>https://blog.asgaard.co.uk/t/ionic</link>
  <lastBuildDate>Thu, 23 Apr 26 02:29:59 +0000</lastBuildDate>
  <language>en</language>
  <count>5</count>
  <offset>0</offset>
      <item>
    <title>Wellburrito</title>
    <link>https://blog.asgaard.co.uk/Wellburrito-mood-tracking-app</link>
    <pubDate>Fri, 01 Jan 21 19:57:44 +0000</pubDate>
    <guid>https://blog.asgaard.co.uk/Wellburrito-mood-tracking-app</guid>
    <description><![CDATA[
<p>
I&#039;m very pleased that we have released the first public version of Wellburrito. 
<p>
Wellburrito is more than just a mood tracking app, it&#039;s a full wellbeing app focusing on mood and custom metric tracking as well as cognitive behavioural therapy (CBT) exercises. 
<p>
Technically, Wellburrito is developed using the Ionic framework. Data is intentionally stored purely locally on the device, i.e. without a server, for the user&#039;s privacy. For this we use an SQLite database, which is optionally backed up to Google Drive on a regular schedule. Android does actually take care of restoring the database on app reinstallation through Google Play, as well, if the user has it enabled, via <a href='https://developer.android.com/guide/topics/data/backup'>Android&#039;s auto-backup feature</a>.
<p>
On the mid to long term roadmap is reducing dependency on things beyond our control that aren&#039;t really of the quality or flexibility we&#039;d like. For example, we&#039;d like to expand the reminders system such that users can interact directly with reminders. When a medication remi[...]]]></description>
    <content:encoded><![CDATA[
<p>
I&#039;m very pleased that we have released the first public version of Wellburrito. 
<p>
Wellburrito is more than just a mood tracking app, it&#039;s a full wellbeing app focusing on mood and custom metric tracking as well as cognitive behavioural therapy (CBT) exercises. 
<p>
Technically, Wellburrito is developed using the Ionic framework. Data is intentionally stored purely locally on the device, i.e. without a server, for the user&#039;s privacy. For this we use an SQLite database, which is optionally backed up to Google Drive on a regular schedule. Android does actually take care of restoring the database on app reinstallation through Google Play, as well, if the user has it enabled, via <a href='https://developer.android.com/guide/topics/data/backup'>Android&#039;s auto-backup feature</a>.
<p>
On the mid to long term roadmap is reducing dependency on things beyond our control that aren&#039;t really of the quality or flexibility we&#039;d like. For example, we&#039;d like to expand the reminders system such that users can interact directly with reminders. When a medication reminder comes up, we&#039;d like to be able to press a little &quot;Yes, I&#039;ve taken it&quot; button. When the mood journal reminder comes up, it&#039;d be good if the user could select a mood within the reminder. Those things are currently not possible because the reminders library we&#039;re using doesn&#039;t support it. Unfortunately, getting the control we need means writing our own library. 
<p>
Similarly, we&#039;d like charts to better fit with the look and feel and branding of the app, but we&#039;ve pushed the current charting solution to its boundaries.
<p>
There are a few little things like this which seem like relatively small features but require a large amount of work. We&#039;ve pushed these back to a future version for the moment, in favour of getting something functional in front of users.
<p>
In terms of features, we&#039;d also like to implement much deeper analysis. Currently we have superficial analysis and reporting of trends and correlations, but there is <em>a lot</em> more we could do with this. Again, this is a &#039;version 2&#039; feature. 
<p>
You can read more about the <a href='https://asgaard.co.uk/wellburrito'>Wellburrito wellbeing, mood tracking and mindfulness app</a> on the official page.
<p>
You can download the <a href='https://asgaard.co.uk/wellburrito'>Wellburrito wellbeing app</a> on <a href='https://play.google.com/store/apps/details?id=uk.co.asgaard.wellbeing'>Google Play</a>.]]></content:encoded>
  </item>
      <item>
    <title>Ionic Native</title>
    <link>https://blog.asgaard.co.uk/ionic-native</link>
    <pubDate>Fri, 01 Jan 21 10:21:58 +0000</pubDate>
    <guid>https://blog.asgaard.co.uk/ionic-native</guid>
    <description><![CDATA[
<p>
Ionic is a framework for developing mobile apps. I&#039;ve completed a few successful projects using Ionic. I like Ionic. I think that as far as cross platform mobile development goes, Ionic is pretty good.
<p>
Ionic was built on Cordova, and has been gradually moving away from it with Capacitor. I like Capacitor better than Cordova. I think they&#039;ve done a really good job.
<p>
Ionic Native is a set of Cordova plugins that they&#039;ve provided a wrapper for. If you look at the list, it looks very impressive. If you try to use any of them, though, it&#039;s a toss up as to whether you end up with something production standard. Some of the plugins there shouldn&#039;t be on the list because they&#039;re just broken.
<p>
The Local Notification plugin is a good example of this. Currently, it&#039;s pointing at the underlying Cordova plugin version 0.9.0-beta2. At the time of writing, this is around three years old. The most recent version is 15 months old. So not only is the plugin not actively maintained, we&#039;[...]]]></description>
    <content:encoded><![CDATA[
<p>
Ionic is a framework for developing mobile apps. I&#039;ve completed a few successful projects using Ionic. I like Ionic. I think that as far as cross platform mobile development goes, Ionic is pretty good.
<p>
Ionic was built on Cordova, and has been gradually moving away from it with Capacitor. I like Capacitor better than Cordova. I think they&#039;ve done a really good job.
<p>
Ionic Native is a set of Cordova plugins that they&#039;ve provided a wrapper for. If you look at the list, it looks very impressive. If you try to use any of them, though, it&#039;s a toss up as to whether you end up with something production standard. Some of the plugins there shouldn&#039;t be on the list because they&#039;re just broken.
<p>
The Local Notification plugin is a good example of this. Currently, it&#039;s pointing at the underlying Cordova plugin version 0.9.0-beta2. At the time of writing, this is around three years old. The most recent version is 15 months old. So not only is the plugin not actively maintained, we&#039;re also out of date even by the plugin&#039;s standards. 
<p>
Unfortunately it doesn&#039;t work very well on modern Android operating systems. Trying to schedule a repeating notification causes the plugin to go into an infinite loop until the OS steps in and kills it, so the workaround is to set a notification with a large &#039;count&#039;. This causes very slow interaction with the notification in future, presumably because the operating system is dealing with a notification instance per count. This is something you can work around by scheduling, say, 100 days in advance and making sure your app reschedules when you&#039;re getting close to the end of the 100 days. You shouldn&#039;t have to do this, but it&#039;s an option.
<p>
However, there&#039;s a much more serious problem in that the plugin can&#039;t schedule notifications that persist past the device rebooting. There are a few use cases where this may be acceptable, but for a general notification system, this is a deal-breaking limitation that you don&#039;t find out about until testing (and physically testing notifications is tedious and error prone enough already).
<p>
Then there&#039;s the in app purchases plugin. The IAP plugin is bizarre. When dealing with subscriptions, there is no way of simply querying whether the user owns a subscription, because the &#039;owned&#039; field isn&#039;t reliable. When the plugin starts up, a subscription goes through a variety of states, but always starts with owned = false. Maybe it reaches owned = true, maybe it doesn&#039;t. The point is that owned = false is never a useful piece of information because there&#039;s no guarantee it&#039;s correct. This means that there is no completely reliable way of determining whether a user&#039;s subscription has expired. You have to look at the subscription billing period and be aware of when it may have expired, and if you go a certain length of time with successful communication with the plugin but without seeing owned = true you then assume that it must have expired. This is absurd, and I would be extremely surprised if the underlying billing library exposes subscription information in this way.
<p>
Ionic should not be providing wrappers (and exposure) for these plugins unless they meet a certain standard. It&#039;s a waste of developers&#039; time to attempt to use sub-standard plugins and will fuel a perception that it&#039;s difficult to achieve production quality software using Ionic.
<p>
Update: Another one - <a href='https://ionicframework.com/docs/native/native-audio'>Ionic Native Audio</a> doesn&#039;t work with Capacitor because it hard codes audio assets as existing within the www/ directory. In Capacitor, this directory has been named public/ so the plugin can&#039;t find any of your audio assets. Again, why is this being advertised by Ionic, with Capacitor instructions?
<p>
See also <a href='https://markwatkinson.com/posts/ionic-cordova-quality'>Ionic Native quality issues</a>.]]></content:encoded>
  </item>
      <item>
    <title>Enabling internet permissions in a Cordova/Ionic app</title>
    <link>https://blog.asgaard.co.uk/2016/10/30/enabling-internet-permissions-in-a-cordova-ionic-app</link>
    <pubDate>Sun, 30 Oct 16 20:34:42 +0000</pubDate>
    <guid>https://blog.asgaard.co.uk/2016/10/30/enabling-internet-permissions-in-a-cordova-ionic-app</guid>
    <description><![CDATA[
<p>
If you try running a Cordova/Ionic app with few plugins, you&#039;ll probably be very confused when you try to create an HTTP request. It&#039;ll work fine in the browser, but on a device it&#039;ll fail.
<p>
If you hook it up to the Chrome developer tools and inspect the webview, it&#039;ll show Status: (failed) and Type: Pending.
<p>
<img src='/assets/img/2016-10-30/cordova-failed-pending.png' class='width-100' alt=''/>
<p>
The answer to this is that you need to ask for access to network permissions.<div class='width-100 clear-fix'>
<p>
<img src='/assets/img/2016-10-30/Screenshot_20161030-122213.png' class='width-40 float-left' title='How your permissions might look' alt='How your permissions might look'/><img src='/assets/img/2016-10-30/Screenshot_20161030-122315.png' class='width-40 float-right' title='How your permissions should look' alt='How your permissions should look'/>
<p>
</div>
<p>
It seems like you should be able to define your app&#039;s permissions in the config.xml file, but this doesn&#039;t seem to be the case. However, plugins can declare permissions in their plugin.xml file.
<p>
So, I created a <a href='https://github.com/markwatkinson/cordova-plugin-internet-permissions'>plugin which does nothing else than defines a plugin.xml which asks for network permissions</a>.
<p>
To install it, use: 
<p>
<code>cordova plugin add https://github.com/markwatkinson/cordova-plugin-internet-permissions.git</code>
<p>
[...]]]></description>
    <content:encoded><![CDATA[
<p>
If you try running a Cordova/Ionic app with few plugins, you&#039;ll probably be very confused when you try to create an HTTP request. It&#039;ll work fine in the browser, but on a device it&#039;ll fail.
<p>
If you hook it up to the Chrome developer tools and inspect the webview, it&#039;ll show Status: (failed) and Type: Pending.
<p>
<img src='/assets/img/2016-10-30/cordova-failed-pending.png' class='width-100' alt=''/>
<p>
The answer to this is that you need to ask for access to network permissions.<div class='width-100 clear-fix'>
<p>
<img src='/assets/img/2016-10-30/Screenshot_20161030-122213.png' class='width-40 float-left' title='How your permissions might look' alt='How your permissions might look'/><img src='/assets/img/2016-10-30/Screenshot_20161030-122315.png' class='width-40 float-right' title='How your permissions should look' alt='How your permissions should look'/>
<p>
</div>
<p>
It seems like you should be able to define your app&#039;s permissions in the config.xml file, but this doesn&#039;t seem to be the case. However, plugins can declare permissions in their plugin.xml file.
<p>
So, I created a <a href='https://github.com/markwatkinson/cordova-plugin-internet-permissions'>plugin which does nothing else than defines a plugin.xml which asks for network permissions</a>.
<p>
To install it, use: 
<p>
<code>cordova plugin add https://github.com/markwatkinson/cordova-plugin-internet-permissions.git</code>
<p>
]]></content:encoded>
  </item>
      <item>
    <title>Your APK&#039;s version code needs to be higher than 100008.</title>
    <link>https://blog.asgaard.co.uk/2016/10/15/your-apk-s-version-code-needs-to-be-higher-than-100008</link>
    <pubDate>Sat, 15 Oct 16 18:59:40 +0000</pubDate>
    <guid>https://blog.asgaard.co.uk/2016/10/15/your-apk-s-version-code-needs-to-be-higher-than-100008</guid>
    <description><![CDATA[
<p>
When trying to upload my <a href='//solvercs.asgaard.co.uk'>Android app Crossword Solver CS</a> to the Play store, I have been encountering the error:
<p>
<pre>Your APK's version code needs to be higher than 100008.</pre>
<p>
The app is an Ionic/Cordova app and Cordova handles creating that version code.
<p>
The 8 on the end makes little sense because the version I had there already was v1.0.0. I checked through git and my config.xml always had the version as v1.0.0.
<p>
<a href='https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-the-version-code'>Cordova claims</a> that the version code will be generated automatically from the string and will be equal to: versionCode = MAJOR * 10000 + MINOR * 100 + PATCH.
<p>
For some reason it has followed this formula, then concatenated an &#039;8&#039; on the end making the end result an order of magnitude too big.
<p>
As far as I can tell this has come about because I used a Linux VM to generate the initial release and a different machine to generate the update. The latter has a newer version of Ionic/Cordova, which presumably does not have the &#039;8&#039; bug.
<p>
How do you fix this? Well, you need to bump up one o[...]]]></description>
    <content:encoded><![CDATA[
<p>
When trying to upload my <a href='//solvercs.asgaard.co.uk'>Android app Crossword Solver CS</a> to the Play store, I have been encountering the error:
<p>
<pre>Your APK's version code needs to be higher than 100008.</pre>
<p>
The app is an Ionic/Cordova app and Cordova handles creating that version code.
<p>
The 8 on the end makes little sense because the version I had there already was v1.0.0. I checked through git and my config.xml always had the version as v1.0.0.
<p>
<a href='https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-the-version-code'>Cordova claims</a> that the version code will be generated automatically from the string and will be equal to: versionCode = MAJOR * 10000 + MINOR * 100 + PATCH.
<p>
For some reason it has followed this formula, then concatenated an &#039;8&#039; on the end making the end result an order of magnitude too big.
<p>
As far as I can tell this has come about because I used a Linux VM to generate the initial release and a different machine to generate the update. The latter has a newer version of Ionic/Cordova, which presumably does not have the &#039;8&#039; bug.
<p>
How do you fix this? Well, you need to bump up one of the components to multiply your end result by 10 and offset it by 8.
<p>
So I have gone from v1.0.0 to v10.0.9, which seems a bit ridiculous.]]></content:encoded>
  </item>
      <item>
    <title>Ionic JavaScript thoughts</title>
    <link>https://blog.asgaard.co.uk/2016/02/21/ionic-javascript-thoughts</link>
    <pubDate>Sun, 21 Feb 16 21:48:58 +0000</pubDate>
    <guid>https://blog.asgaard.co.uk/2016/02/21/ionic-javascript-thoughts</guid>
    <description><![CDATA[
<p>
First, <a rel='external' href='http://ionicframework.com/'>Ionic</a> is a JavaScript framework for building mobile apps. It&#039;s built on Cordova (the free version of Phonegap) and AngularJS and gives you a set of tools for compiling your code into a native app with a webview. It comes with some AngularJS services and directives for emulating mobile functionality as well as handling effects like screen sliding transitions.
<p>
In general I was surprised by just how native the running product feels. You have to do some work to keep it that way, of course, but for a simple forms based app it&#039;s very achievable to end up with something that looks and feels native. Savvy users will spot the difference, but most probably won&#039;t. The CSS graphics performance on a modern iOS device (say iPhone 5+) is very good and the animation effects are smooth. On Android (5) things are a bit choppier, but still acceptable.
<p>
The other major positive is that it&#039;s much more convenient to develop things locally in a browser, and use all the debugging tools that come with it[...]]]></description>
    <content:encoded><![CDATA[
<p>
First, <a rel='external' href='http://ionicframework.com/'>Ionic</a> is a JavaScript framework for building mobile apps. It&#039;s built on Cordova (the free version of Phonegap) and AngularJS and gives you a set of tools for compiling your code into a native app with a webview. It comes with some AngularJS services and directives for emulating mobile functionality as well as handling effects like screen sliding transitions.
<p>
In general I was surprised by just how native the running product feels. You have to do some work to keep it that way, of course, but for a simple forms based app it&#039;s very achievable to end up with something that looks and feels native. Savvy users will spot the difference, but most probably won&#039;t. The CSS graphics performance on a modern iOS device (say iPhone 5+) is very good and the animation effects are smooth. On Android (5) things are a bit choppier, but still acceptable.
<p>
The other major positive is that it&#039;s much more convenient to develop things locally in a browser, and use all the debugging tools that come with it, than to go through the much longer debug cycle of deploying native code and trying to use an unfriendly debugger that frequently just dumps you to a page of assembly code. I definitely find HTML, CSS and JS to be a faster and more pleasant development environment than Objective C and Xcode&#039;s UI designer (I can&#039;t speak for native Android development).
<p>
There are also downsides to Ionic:
<p>
Native functionality is provided through plugins. These are community made and the quality is wildly variable. It is easy to end up digging through the source of these yourself. On iOS, these will occasionally conflict with each other due to bad namespacing by the author. Most plugins will support iOS and Android, but support for other mobile OSes gets patchy quickly.
<p>
Although it&#039;s write-once-run-anywhere, you do end up spending a lot of time fiddling with OS specific CSS bugs. iOS&#039;s HTML renderer is far from perfect, but Android&#039;s is pretty good!
<p>
The build process is a bit annoying and we&#039;ve found it hard to lock everything into our version control system due to some things about the way ionic is structured, especially in regard to mixing Linux (which can&#039;t build for iOS) and Mac machines in our project. We&#039;ve also had numerous things break unexpectedly which later turn out to be due to some detail of the build process.
<p>
Ionic&#039;s JavaScript libraries are of variable quality. I recommend simply not using $ionicPopup at all and instead writing your own popup library (or finding another one), because the one built into Ionic has some catastrophic bugs like the fact that displaying two popups at once will render the first unresponsive, which means the user has to restart the app. There&#039;s also a timing issue with rendering a popup during a screen transition which will cause the popup to not have any buttons (so again, the user has to restart the app because they can&#039;t close it). The developers do not appear responsive in fixing these issues. Other services have smaller bugs which are less problematic, but still don&#039;t inspire a huge amount of confidence.
<p>
Overall: pretty good, but not without problems.]]></content:encoded>
  </item>
  </channel>
</rss>