Post Image

My iOS Build Won't Install

Recently I sent a build and had an issue installing it. It was late at night and I just forgot to add the build hint ios.debug.archs=armv7 for installation on the 3rd gen iPad I was testing with. So we can all trip over basic mistakes when it comes to iOS installs. So for your convenience I made a list of common pitfalls you might run into if your iOS build won't install on your device.

Read More
Post Image

Threadsafe SQLite

One of the main reasons for the thread API I discussed yesterday is a new threadsafe Database API. This new API allows you to wrap your `Database` instance with a thread that will hide all access to the database and implicitly make it threadsafe by serializing all requests to a single database thread.

Read More
Post Image

Fingerprint/TouchID Support

Fingerprint scanners are pretty common in modern hardware both from Apple and some Android vendors. The problem is that the iOS and Android API's for accessing them are a world apart. However, it's possible to find some low level common ground which is exactly what our cn1lib for fingerprint scanning accomplished.

Read More
Post Image

Braintree (PayPal) cn1lib

As part of the bootcamp we wrote a couple of cn1libs and the first one is the Braintree cn1lib which allows us to do credit card payments within an app. If you aren't familiar with Braintree it's a PayPal company that provides payment integration for mobile devices.

Read More
Post Image

TIP: Use the Native EDT

The bootcamp is winding down and I'm finally back to our usual scheduled posts. I'd like to open with a common practice that isn't nearly documented enough: use the native main/EDT threads. Our EDT serves many purposes but one of it's biggest roles is portability. By having an EDT we get consistent behavior across platforms.

Read More
Post Image

Big Changes and Bootcamp Updates

Since I haven't blogged in a while a lot of stuff has piled up on my desk and I'll get it out in batches in this post I'll go over a few of the bigger changes we did while I was away on the bootcamp and also give you a bit of an update on what we've been doing within the bootcamp itself.

Read More
Post Image

Moving to 64bit by Default

When building an iOS debug version of the app we only build a 32bit version to save build time. Otherwise the build will take almost twice as long as every file would be compiled twice. This worked well and was also fast enough. However, Apple started sending warnings to old 32bit apps and mistakes our apps as such.

Read More
Post Image

Autosizing, Add All & iOS Redirects

One of the common requests we received over the years is a way to let text "fit" into the allocated space so the font will match almost exactly the width available. In some designs this is very important but it's also very tricky. Measuring the width of a String is a surprisingly expensive operation on some OS's. Unfortunately, there is no other way other than trial & error to find the "best size".

Read More
Post Image

Block Copy/Paste & Faster Performance on iOS

I discussed both of these last week but we've made some progress that warrants a dedicated post. We added a new feature that allows you to block copy & paste on a text component either globally or on a case by case basis. This is helpful for highly sensitive applications.

Read More
Post Image

Intercom Support

We use intercom.io for our website support system you can see it as the chat button on the bottom right of the page. The true value of this tool is in it's ability to deliver a unified interface everywhere, normally this stretches into native mobile apps as well. As a result we decided to port the native intercom device API to Codename One so it will be easy to deploy everywhere.

Read More
Post Image

Z-Order Peers in iOS & JavaScript

Just last week I mentioned the effort we were taking to bring the z-ordered peer components into other platforms and I'm pretty happy to report that tomorrows update should include support for iOS & the JavaScript ports for z-ordering.

Read More
Post Image

Can Execute Hint

Display.canExecute(url) provides us with a generic tool to test the availability of a feature before executing a command. This is very useful for inter-app communications and allows us to achieve various things such as launching Google Map instead of Apple Maps on iOS.

Read More
Post Image

Jailbreak/Rooting Detection

iOS & Android are walled gardens which is both a blessing and a curse. Looking at the bright side the walled garden aspect of locked down devices means the devices are more secure by nature. E.g. on a PC that was compromised I can detect the banking details of a user logging into a bank. But on a phone it would be much harder due to the deep process isolation.

Read More
Post Image

Automatic Build Hints Configuration

We try to make Codename One "seamless", this expresses itself in many small details such as the automatic detection of permissions on Android etc. The build servers go a long way in setting up the environment as intuitive. But it's not enough, build hints are often confusing and obscure. It's just hard to abstract the mess that is native mobile OS's and the odd policies from Apple/Google...

Read More
Post Image

Auto-Renewing Subscriptions in iOS and Android

Auto-renewable subscriptions provide, arguably, an easier path to recurring revenue than non-renewable subscriptions because all of the subscription stuff is handled by the app store. You defer almost entirely to the app store (iTunes for iOS, and Play for Android) for billing and management.

Read More
Post Image

Implementing Non-Renewable Subscriptions with In-App Purchase

Non-renewable subscriptions are really the same as consumable products, except that they are shareable across all of a user's devices. Auto-renewable subscriptions, on the other hand, will continue as long as the user doesn't cancel it. They will be re-billed automatically by the appropriate app-store when the chosen period expires, and all management of the subscription is handled by the the app-store itself.

Read More
Post Image

Introduction to In-App Purchase

In-app purchase is ahelpful tool for making app development profitable. Codename One has supported in-app purchases of consumable and non-consumable products on Android and iOS for some time now, and with the next update we are adding support for subscriptions. For such a seemingly simple task, in-app purchase involves a lot of moving parts - especially when it comes to subscriptions.

Read More
Post Image

Template - Phoenix UI

The Phoenix UI kit by Adrian Chiran is one of the best looking and most challenging template UI's I had to adapt in recent history. The breadth of the design is pretty challenging but it also has some elements that are really hard to adapt across platforms in a portable way.
In fact, some elements only work on devices and don't even work properly for the JavaScript port e.g. the floating action button gradient color and the round look of the walkthru UI.

Read More
Post Image

Faster iOS Builds, GUI Builder Improvements & SQL Updates

I've recently noticed that distribution build sizes were identical for appstore and debug builds which wasn't the case before the xcode 7.x migration we did a while back. This shouldn't be the case as it indicates that the standard debug builds include both the 64bit and 32bit code which is redundant during debugging.

Read More
Post Image

Template - Clean Modern Cross Platform Mobile UI Kit

In the previous template post I introduced a material design inspired theme. This time the theme I chose is simpler "cleaner" but not necessarily easier to integrate. I've had quite a few difficulties wrestling with Photoshop oddities (bugs?) that made this template painful, hopefully I've narrowed down the process enough so this should become easier.

Read More
Post Image

How to: Port Native Android App to iOS (iPhone) Guide

We get contacted quite a bit about the prospect of porting applications that were already written using the Android API. In this quick tutorial we will walk you thru the paces of converting a simple Android application to a Codename One application. We will also start with some basic tips covering the differences between Android and Codename One development.

Read More
Post Image

Template - Mobile Material Screens UI Kit (Cross Platform PSD)

Generating a template from a PSD isn't hard but it isn't a trivial task either, in this recurring segment I will try to generate good looking Codename One templates from freely available PSD files. Since this requires some effort I don't think I'll be able to keep this as a weekly segment but I'll try to post such a template once every two or three weeks. If you know of a free PSD that you'd like to see as a Codename One app point me at it in the comments and I might integrate it in a future post!

Read More
Post Image

Tutorials & Resources - Learn Java on Mobile videos courses for iOS, Android etc.

There are many Codename One resources for building native mobile apps but they are often all over the place, in this blog post I'll try to concentrate the best resources for people who already know Java and are looking to pick up Codename One. If you don't know Java yet please check out this post where we discuss resources for beginners to Java.

Read More
Post Image

Cross Platform Mobile still Better than Naive in age of Flat Design

A few years back I wrote an article for O`Reilly covering the advantages of cross platform over native OS code. Almost 3 years have passed and a lot has changed in our industry so I wanted to re-examine how this impacts my perspective on cross platform vs. native.

Read More
Post Image

Deploy the Same Mobile App/Template Multiple Times

We often build one app and sell it to multiple customers. After all, most customers ask for similar things with minor changes. E.g. if I build a restaurant app and then sell it to one establishment I can then resell it to another with almost no change at all...

Read More
Post Image

Different Icons

When we designed the icon for the new Kitchen Sink demo we tried to use material design principals. We thought it would look reasonable on iOS but it looked awful. So we decided to adapt the design and create a separate yet similar icon for iOS.

Read More
Post Image

Performant Radial Gradients

One of the first Codename One performance tips is: "Don't use gradients". We already wrote about improved performance to gradients in the past but that covered linear gradients and didn't cover radials on iOS.

Read More
Post Image

Xcode Migration Revisited Again

We tried migrating to the new iOS build servers before and decided to revert the change due to xcode crashes. After a lot of work we think the new server code is ready for production. We will try to migrate to these new servers again on the 28th of August (Sunday) to minimize impact if something goes horribly wrong.

Read More
Post Image

XCode Migration Take 2

We hoped to get the xcode 7 migration on the build servers out before version 3.5 but the change had problems and we chose to revert. We postponed the change so we can get 3.5 out of the door...
This Sunday we'll deploy a server update that should be the first step in the migration.

Read More
Post Image

Offline Build

We finished the final major piece of the offline build offering that we announced in July!
This Sunday we will update the plugins to include this ability as an option. Once installed you can use the instructions below to install the offline build service.

Read More
Post Image

Featured App - Ana Paltel

Millions of Codename One apps are installed on devices every month. Most of them aren't in the gallery and are never featured in this recurring segment. We are looking for something exceptional in apps that we feature here and Ana Paltel fits that bill. It has a very polished UI and it is shipped by a major operator. It uses some unique Codename One features to boot making it even more interesting.

Read More
Post Image

Alphabet Scroll

We got a lot of requests from developers over the years to do an iOS style alphabet side scroll. Some developers implements such scrolling but no one made it generic or contributed it back. So a recent stack overflow question got me thinking about how easy it would be to actually implement something like that and I decided to try...

Read More
Post Image

Peering Revisited

I blogged about peer components all the way back in 2014 trying to explain basic facts about their limitations/behaviors. A lot of those limitations are inherent but over the past year or so we've been thinking more and more about the z-order limitation.

Read More
Post Image

Device Tester

A common issue we get from developers relates to minor differences between devices which are often very hard to quantify. They are also very hard to explain to the developers in some occasions. One of the biggest points of difficulty is density which is a very hard concept to grasp and it's often hard to know which image will be used from the set of multi images or how many pixels will be used for 1 millimeter.

Read More
Post Image

Background Fetch

Background fetch allows an app to periodically "fetch" information from the network while the app is in the background. This is scheduled by the native platform, where apps that support background fetch will be started up (in the background), and their performBackgroundFetch method will be invoked.

Read More
Post Image

iOS Http URL's

We'll be migrating to the new iOS build servers this Sunday and this does entail one major thing you need to be aware of. With the new version of xcode http URL's are blocked by Apple. We blogged about this a while back but this bares repeating as it's something a lot of you will start running into.

Read More
Post Image

Bluetooth Support

Bluetooth is one of those specs that makes me take a step back... It's nuanced, complex and multi-layered. That isn't necessarily bad, it solves a remarkably hard problem. Unfortunately when people say the words "bluetooth support" it's rare to find two people who actually mean the same thing!

Read More
Post Image

Cocoapods Support

CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. It has over eighteen thousand libraries and can help you scale your projects elegantly. Cocoapods can be used in your Codename One project to include native iOS libraries without having to go through the hassle of bundling the actual library into your project. Rather than bundling .h and .a files in your ios/native directory, you can specify which "pods" your app uses via the ios.pods build hint. (There are other build hints also if you need more advanced features).

Read More
Post Image

iOS Server Migration Plan

We were stuck on an "old" version of xcode in the build servers. This hasn't been a big deal for most features but in some cases we are running into issues e.g. in using the full capabilities of the new iPad or 3d touch. The reason for this is Apples backwards compatibility policy.

Read More
Post Image

Featured App - yHomework

We're all pretty jaded when it comes to software but when I first saw yHomework I was completely floored by it!

Where was this tool when I was in junior high?

If you haven't seen yHomework in action I suggest you give it a try right now on your Android or iOS device.

Read More
Post Image

Zip and Toast

One of the often requested features in Codename One is zip support, we had some issues with it until a couple of years back we added tar and later gzip support. But people still asked for standard zip file support which was missing.

I'm working on a tool that I hope to share next week that needs zip to work, initially I wanted to do this natively as zip works on most native OS's but one of the true benefits of the tool is if we can get it to work in the JavaScript port live on the web...

Read More
Post Image

Featured App - Pumpop

Pumpop is a social networking app in the spirit of tinder that is available globally and installed on many devices all over the world. One of its major draws is it's portability which will soon extend to Windows Phone as well.

Read More
Post Image

Featured App - JAT Communication

The jat app is very similar to whatsapp in some regards but is more oriented towards group communication than SMS replacement. Over the past couple of weeks we picked it up as a great communication tool in our team. It uses push notifications to notify and activates accounts via SMS. This makes it very convenient for someone like myself who moves between devices constantly.

Read More
Post Image

Open File & Rendering

As part of our continuing effort to squash bugs for the 3.4 release date we hit two major issues, the first of which is a long time RFE to fix PDF viewing on iOS and Android to work consistently. This also applies to any file opening in iOS/Android which should now be trivial with the Display.execute method. Just use that method on any file within your home directory in FileSystemStorage and it should launch the native app to view that file.

Read More
Post Image

Windows, IDEA, Enum Values & ContactsManager Refresh

Steve committed the upcoming Windows port to out github repository it's still work in progress so you can't physically target it as part of the build system although we hope to move this port out relatively quickly. This should be more doable thanks to the iKVM route and the work from Fabricio both of which saved a lot of the effort in this port.

Read More
Post Image

Wiki, ParparVM Performance, ActionEvent Type & more

Following with the feedback on the recent survey we spent a lot of time debating how we can improve the general process of documentation and ideally have the community more involved. So one of the first things we did is place our entire developer guide directly into the Codename One Wiki!
This allows any one of you without any special permissions (just a standard github account) to edit the wiki directly. No pull request or anything like that required. The syntax is based on asciidoc which is reasonably intuitive so if you see something wrong/missing etc. just edit it directly, we review all changes after the fact so if you get something wrong we will fix it!

Read More
Post Image

The Sad State of Android Performance Tooling

Historically, we didn't use Androids profiling tools often. They were pretty awful and the only tools that we really used extensively were the on-device GPU profiling tools which were reasonably good. In recent years Android's native story improved by leaps and bounds with the introduction of Android Studio and 3rd party tools developing native Android apps has improved a lot. But the CPU profiling tools are still stuck in the stone age and this is in stark contrast to the iOS tooling.

Read More
Post Image

ParparVM Spreads Its Wings

We wrote quite a bit about the architecture of the new VM we built for iOS and why we built it. Up until recently we always viewed it as a Codename One specific tool. Something that would only be useful for us. We used open source because "that is our way" and didn't give it much thought after that.
It started to dawn on us recently that this tool could be useful for other developers that might take it in a different direction from our original intention. We also came to the conclusion that this might not be a bad idea altogether.
So we are are effectively launching the Codename One VM as ParparVM and it includes a lot of interesting benefits.

Read More
Post Image

Material Icons, Background Music, Geofencing & Gradle

We became infatuated with icon fonts a while back and used them quite a bit, recently we added the FontImage class that made them really easy to use.
However, up until now you had to download a font. Look up the value and enter it in. This was OK but not ideal in terms of syntax/availability especially for simpler apps.

Read More
Post Image

Migration To The New Push Servers Completed

Today we dealt with some push messages overloading our servers, some of the apps developed in Codename One are remarkably successful and as a result our push servers got bogged down.
To mitigate that and prevent service interruptions we moved all push activity to the new servers, this effectively means that a push operation on the old servers will map to the new servers seamlessly. This also means that we no longer support the null push target even for the old push servers. Its just too expensive to support on scale of 150M+ devices.

Read More
Post Image

Hiding, URL Security & Advocacy

A common trick for animating Components in Codename One is to set their preferred size to 0 and then invoke animateLayout() thus triggering an animation to hide said component. There are several issues with this trick but one of the biggest ones is the fact that setPreferredSize has been deprecated for quite a while.

Read More
Post Image

iOS Certificate Wizard

So you have finished your app and tested it on the simulator. Everything looks good. You're now ready to proceed with testing on your iPhone. You select the "Send iOS Debug Build" menu item and wait for the build server to work its magic, but then you're faced with a notice that iOS builds require a valid certificate and provisioning profile. What a hassle!

Read More
Post Image

Smaller iOS Source Builds, Timer & Index

Up until now when building with include sources for iOS we also included a btres directory which was necessary for the old VM but no longer necessary in the new VM. This increased the distribution size considerably and we are now removing it to speed up the builds and reduce server costs. When we were in the process of reviewing the sizes of apps we noticed quite a few apps with resources weighing well over 5mb which would probably cause performance issues for your application, we suggest reviewing such apps and optimizing them.

Read More
Post Image

Map, String Performance & JavaScript Native

We've been spending a lot of times looking at performance for one of our enterprise customers. As part of the investigation he came up with an interesting and very important find... He found that hashMap.get("String") was much slower under the new VM than under the old VM. Its these sort of "simple" finds that help narrow down bigger issues in performance that might impact a lot of things in Codename One, since HashMap is so ubiquitous the implications of improving it can be huge.

Read More
Post Image

Storage Migration

Our iOS port has some pieces that are pretty old and haven't been touched since we started, one of those things is the IO code which mostly works as we wrote it when we started Codename One. Unfortunately it seems that Storage in iOS is mapped to the iOS caches directory, this directory can be wiped by the iOS device if space on the device is running low. That's a very rare occurrence which is why we didn't pick that up until a bug report was filed on it this week...

Read More
Post Image

GC Crashes & Bugs

As part of tracking a bug in iOS media playback Steve hit upon some code that recreated the OpenGL framebuffer pretty much all the time. This was there to allow device rotation to work, but was implemented incorrectly...
After this fix animations and UI is much smoother on iOS, if you notice any potential issues let us know.

Read More
Post Image

Gallery, Icons & Updates

Now that the new website is live we are down to standard business again beyond just the typical bug fixes. Chen just updated the gallery support to include the ability to pick a video file and not just an image file...

Read More

Flurry Interstitial Ads & Analytics

Post Image

Chen was working with a customer that needed some specific ad network support and decided to open source some of that work. We now have integration with Flurry both for its ads and analytics support both of which are pretty cool and have some distinct advantages over the current Google equivalents.

Read More

Codename One Graphics - Understanding Coordinates

Post Image

Codename One provides a rich set of drawing primitives in its Graphics class. It allows you to draw text, shapes, and images to the screen. The position where these elements will be rendered is determined based on a combination of Graphics state information (e.g. the current translation, and transform) and coordinates that are passed to the drawing method. Understanding how these coordinates are calculated can be tricky when you first begin using the API.

Read More