Nov 7, 2015

Short Note: HTML5 localStorage - think "resume"

Just realise something that I have been using it so long,
while still not knowing one of the best part of its "resumable" feature.

It keeps what you last stored in the localStorage, and won't lost the stored data until you do it manually.

In this case,
we can check any progress updated before any kind of interruption,
and resume the progress from there.

One of my concern was that I didn't know I can really trust the stored data while having an interruption happens in the middle of the process.

Thanks to Dive Into HTML5: HTML5 Storage in Action,
I should start utilise it with progress status data and think localStorage from know on.
(Even though it isn't a very new thing anymore)

Oct 8, 2015

Cordova Development - iOS iTunesArtwork in ad hoc distribution

As how everyone explained around the internet, you need files named "iTunesArtwork" (512px X 512px) & "iTunesArtwork@2x" (1024px X 1024px).

iTunesArtwork - 512 x 512
iTunesArtwork@2x - 1024 x 1024

And they must be filename without extension.
If your image file is iTunesArtwork.png then name it to iTunesArtwork (without the ".png").



Once you have your artwork ready, rebuild your iOS Cordova build.
cordova run ios 
After then, the generated app (applicaiton) file:
generated-app.app (in /mobile_app_root/platforms/ios/build/device/generated-app.app directory)



right click on the generated-app.app and select "Show Package Contents"




After you click [Show Package Contents], it will direct you into a new directory.
This is the directory where you should place your iTunesArtwork & iTunesArtwork@2x files.



In root folder, is where you place your  iTunesArtwork & iTunesArtwork@2x files.


Try it in iTunes app, you'll see the result.


References:
Customizing the App
iTunesArtwork And Xcode

Cordova Development - How to release an iOS build from app bundle generated from "Cordova run ios"

By running, cordova command, cordova run ios will generated an iOS application bundle in
cordova-project-directory/platforms/ios/build/device/app-name.app

 Using manual way to distribute testing build, you'll need to:


  1. Create a folder named "Payload" (only 'Payload' name would work)
  2. Paste your app-name.app into the Payload folder created in 1st step
  3. zip/compress the Payload folder
  4. once compressed, the Payload folder become Payload.zip, rename the 'Payload.zip' to app-name.ipa
  5. Place it into iTunes, and start install with it.

Sep 24, 2015

Replace default look of SELECT box or dropdownlist on mobile webview

I am using onsen-ui HTML5 UI framework to create my webview mobile app.
With the help of:
  <ons-list-item modifier="tappable">
  </ons-list-item>
On onsen-ui, it does not help inherit existing design into the select box.
An example below.

Default design of the select box on iOS
In this case,
we'll have to write a custom CSS class for the select box to replace the default design.


  .custom-select-box {
    color: inherit;
    font: inherit;
    line-height: initial;
    direction: rtl;
    overflow: hidden;
    height: 40px;
    width: 100%;
    padding: 5px 8px;
    border: none;
    box-shadow: none;
    background-color: transparent;
    background-image: none;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
    option {
      direction: initial;
    }
  }

the main part which replace the default view is:
directional: inherit;
appearance: none;
border: none;

Final result

Sep 20, 2015

Building Cordova iOS app with xcode7 run into "Build failed with Ld build/Debug-iphoneos/ normal armv7" problem

This problem occur because of the enable_bitcode feature of xcode7, and I suspect this occur is because some cordova plugin we're using does not contain bitcode.



In order to solve this problem:
As default value is a "Yes" for iOS, you'll need to disable it on your own.

To do: Disable "Enable Bitcode" setting inside Build Settings.

  1. select targeted app
  2. select "Build Settings" tab
  3. at the search bar under the tabs, search for the keyword "bitcode" (or find it under Build Options)
  4. change Enable Bitcode to "No".


Enable Bitcode



Try to Build your app again.

References:
What does enable bitcode do in xcode 7