• Home
  • About
  • Android Fragmentation

    November 24th, 2011


    The latest issue of the german Android360 magazine is featuring an article by our Android experts about fragmentation on the platform.

    Fragmentation on the Android platform comes in several flavors.
    Mobile devices in the wild can differ on their installed Android version, their screen size/resolution and their supported hardware features.
    With the advent of Android tablets the platform added a new class of supported hardware to its portfolio.
    The article summarizes the main does and don’t to tackle fragmentation successfully.

    If you are experiencing fragmentation problems in your Android project or want to avoid them upfront, talk to us. Our share-a-canooie service might be just the right thing for you.

    Remember: think Android, think Canoo


    Android and IDEA for the Eclipse Refugee

    October 18th, 2011

    Earlier this month I switched from writing my Android projects in Eclipse to writing them in IntelliJ IDEA. Overall the experience has been great, and I much prefer using IDEA to Eclipse for Android development. And now that IntelliJ IDEA 11 EAP (Early Access) has a visual layout window, there is almost no reason for me to write my Android apps in anything else. I wrote this post to help other users along their way when converting between the IDEs.

    Why IntelliJ IDEA for Android?

    There’s no need to ask why if IDEA is already your favorite IDE or if your company is forcing you to use it. But just in case you’re not already a raving fanboy, here are some of the features specific to Android that made me want to switch.

    Find usages (Alt+F7) is aware of Android XML resources (and the semantic meaning of their content), so searching across project assets is easier. Plus, I just find IDEA’s search capabilities a little saner than Eclipse’s. Below you can see what happens when I search from within my layout XML file for a certain widget ID:

    01. Find Usages

    Find Usages in IDEA

    Because IDEA knows about the Android XML resources, refactorings like Rename (Shift+F6) work across Java code and XML. You can rename a widget’s ID from the XML file and have the Java code updated, or rename from the Java code and have the XML updated. Here I am renaming a widget ID in XML. Nice. In general, I do not search within comments and Strings because it is a little too aggressive.

    02. Rename Refactor

    02. Rename Refactor

    There are several Android specific intentions that make life easier in IDEA. Intentions are the quick-fixes that are activated in Eclipse with Ctrl+1. In IDEA you use Alt+Enter. For example, if there is a static String referenced from your code then you should make that String a resource by moving it to strings.xml. Put your cursor into the String, press Alt+Enter, accept the name suggestion, and you’re ready to go. Ctrl+Z for undo on refactorings work great, too. One of the big differences between IDEA and Eclipse is refactoring support. In IDEA, the source files do not need to compile in order for refactorings to work. It is quite common to have a broken file and fix it through a couple automated renames or refactors.

    03. Move Refactor

    03. Move Refactor

    Finally, before IDEA 11, the killer feature for Eclipse Android was the visual editor for XML based layout files. Personally, I don’t often use drag and drop layout editors but I do value seeing my code changes immediately without recompiling and redeploying. Eclipse had the better feature set. But IDEA 11 now has a layout “Preview” mode. Make a change in the XML and see it immediately updated in the preview. You can also quickly change the theme, preview in landscape and portrait, switch to night mode, and select different screen sizes. If you absolutely need a visual editor, then Eclipse is the way to go. Otherwise, the Preview in IDEA 11 is good enough. More info available on the IDEA blog.

    04. Visual Preview

    04. Visual Preview

    Let’s get started with a tour of IDEA.

    Getting Oriented in IDEA

    The basic layout of IDEA is not all that different from Eclipse. You have a main code window (right, in image below), you have a Project View (upper left), and you have a Structure View (lower left). If there is a window for it in Eclipse, then there is probably a window for it in IDEA. A good way to get started and get familiar with IDEA is to read the DZone IDEA RefCard I wrote a few years ago. It is still relevant today. I highlighted the image to show the relevant details.

    05. Project View

    05. Project View

    At any time you can jump to the code window by pressing Escape, and you can close any open tool window with Shift+Escape. On thing that IDEA does not have is perspectives. Maybe you love Eclipse perspectives. Maybe you love when your code view shrinks up into a postage sized porthole whenever you launch a debugger. Who knows, perhaps this is useful to you somehow. I am trying very hard to be positive here, and the nicest thing I have to say about perspectives is that I hate them. Another thing IDEA does not have is a “Team Plugin”. There is no single “Team” abstraction that somehow fits on top of every version control system. Instead, when you enable Subversion then you use Subversion features. Git uses Git Features. Version control systems are enabled using the Tools->Enable Version Control menu item. Then the Alt+9 shortcut brings up the Version Control View.

    Running, Debugging, and the Android Tools

    Running and Debugging an application is slightly different in IDEA than in Eclipse. You manage your “Run Configurations” using your Run/Debug dropdown menu at the top of the screen:

    06. Run/Debug Configurations

    06. Run/Debug Configurations

    You can create temporary and permanent run configurations. Right clicking a test and choosing Run creates a temporary run config. If you want to run the target repeatedly then just save it so it is permanent. And you Maven users: you can right click a goal in the Maven view and create a run target, such as a run:jetty goal. The Maven support is amazing in IDEA, so you are actually lucky to be a Maven user in this case.

    The features of the debuggers are fairly close between the two products. Set a break point by clicking in the gutter (Ctrl+F8), select and right click a reference to add to the watch window. I’ve noticed that Eclipse users love to enable and disable breakpoints rather than just set and remove them. Well, you can press Ctrl+Shift+F8 to manage all your breakpoints if that’s the sort of thing you like to do. Also, notice the Logcat tab on the debugger, which shows you the Android log. If you are Running (and not debugging), then the Logcat output is in the “Android Logcat” view that you see on the bottom toolbar:

    07. Debug Window

    07. Debug Window

    The main Android Tools from the SDK are available under the Tools->Android menu. You can export a signed package this way and also launch the AVD to manage your emulators and environments. If you need the other SDK tools like “hierarchyviewer” or “monkeyrunner” then you’ll have to launch them from the command line. There is built-in Android testing support in IDEA, and when you run a unit test then the IDE will ask you whether to run it as a JUnit test or an Android test. It remembers your answer, so if you make a mistake then just delete the run configuration and start over. It will ask you again.

    Managing Your IDEA Project

    The two hardest parts of switching IDEs is Project configuration and Web Server configuration. Luckily we avoid the latter in an Android tutorial. But you still need to set up the project. First, some terminology. An “Eclipse Workspace” is an “IDEA Project”. An “Eclipse Project” is an “IDEA Module”. An Eclipse Workspace is composed of several projects. An IDEA Project is composed of several modules. If you have Eclipse project files then IDEA should be able to import them with no problems, and this is the fastest way to get started.

    The Project is configured using the File->Project Structure menu item. You can also open the window using the Ctrl+Alt+Shift+S shortcut, which I call the Paw Mash because holding your left hand like a bear paw and mashing the keyboard usually suffices to open the window. This is where you specify your source folders, your SDK version, and your dependencies. If there is no Project SDK selected in the dropdown list, or if the list shows an error, then click on the SDKs item in the left side pane to create a new one.

    08. Project Configuration

    08. Project Configuration

    Configure the modules by clicking the module entry on the left side. Here you can mark certain folders as source or as tests. By default, a fresh IDEA Android project has no “tests” folder, so you should add the folder and then come in here as mark it as Test Sources. You can also change some of the Android compiler settings by clicking the Android facet shown in the middle.

    09. Module Configuration

    09. Module Configuration

    One last thing to configure before leaving the window. If you are writing JUnit tests then you’ll need to add JUnit to your project dependencies. If you just annotate a method as @Test then IDEA prompts you to add the junit.jar to your classpath. The problem is that they add it as the last dependency, which causes the test to fail with the error “java.lang.RuntimeException: Stub!”. Come into this window and move JUnit up in the dependency list. Or configure Ivy/Maven/Whatever to do this automatically for you.

    10. Module Dependencies

    10. Module Dependencies

    That’s the quick tour of Project Structure… lets move on to Settings. Settings are the options not directly related to compiling the project. Things like code style, version control, plugins, and much more. Open Settings using File->Settings or use your Claw Attack to hit Ctrl+Alt+S. I call this shortcut the claw attack because if you pinch your left hand into an eagle claw and swoop it down on your keyboard then the Settings window usually opens right up. It helps to let out a mighty, “Ka-KAW” when you do it.

    There are thousands of settings in here. I heard the advice recently that new users of either IDE should spent a few hours just clicking around the settings page, and I honestly think that is pretty good advice. If you know what you’re looking for but can’t find it, then enter your search term in the upper left side search box and the settings list dynamically displays only those pages with matching entries. For instance, if you know you want to show line numbers, then type in Line or Line Numbers and click through the resulting pages. In this case, the highlighting you see in the image was created by IDEA and is used to point you to the correct setting.

    11. Settings Configuration

    11. Settings Configuration

    You most definitely want to change some of the default settings. Showing Line Numbers is under Editor->Appearance. Changing your tabs and space settings are done on a per-file type basis, and is accessed from Editor -> Code Style. By default IDEA allows you to place the cursor past the end of the line in a text file, and you turn this off under the Editor page. And Version Control is something you really must configure as well, which is under Version Control. GitHub integration in IDEA is tip-top and goes beyond just Git support, but lately I’ve been using and recommending BitBucket for free, private git hosting. In general I find myself using the IDE to make local commits and manage changelists, and the command line to perform pushes.

    Links

    That’s it! There are tons of ways to learn more, and here are my favorite links:

    As always, feel free to keep in touch by leaving a comment. You can read more from me on my blog at http://hamletdarcy.blogspot.com/, see my YouTube channel for more screencasts, and follow me on Twitter: @HamletDRC


    MobileTech Conference 2010 wrap up

    September 10th, 2010

    This years MobileTech Conference took place from 6.-8.9. in Mainz at the Rheingoldhalle.

    In his keynote Tim Bray (Google Android advocate) did not fail to stress the importance of the mobile business by showing some impressive numbers, charts and statements.
    6.8 Billion people worldwide, 3.6 Billion mobile subscriptions, +1 Billion mobile devices / year.
    The whole mobile business is a Trillion (yes, T!) dollar business and the the biggest digital business (asymco.com).
    Eric Schmidt: if your web strategy won’t be successful on mobile, it will not succeed at all.
    Steve Jobs: we are a mobile company.

    Web vs. native?

    Actually to Google the question is open. Both approaches have their know advantages and disadvantages. The market will show and in the meantime they’ll do both (see Chrome and Android).

    Whats the ideal number of mobile platforms in the world? (provocative)

    Certainly 1 is not ideal, that’s the conclusion from the Windows Desktop OS experience.
    Will the technical aspects decide, compiling down to the metal vs. running a VM?
    Certainly the big players are iOS, Android and web.
    Again, the market will decide. He believes that Blackberry is here to stay (well at least for some more time), he wouldn’t count Nokia out, but Windows is certainly not a player showing only vaporware atm. He was wishing WebOS (Palm) to succeed, but questioned that HP has the necessary brains to achieve that.

    How to earn money in the mobile software business?

    With respect to monetization through Appstores the revenue distribution is inverse squared. That means not many people are earning serious money by selling apps.
    Potential ways of monetizing apps are as follows:
    sell apps, sell app upgrades, sell in app ads, do in app sales, sell whats on the server
    Currently selling apps and selling ads in apps generate equal amounts of revenue. For the future he is expecting the ad side to increase a lot.
    He concluded the talk by stressing the importance of privacy in the mobile business.
    He himself actually does not feel easy giving away his physical location, interesting …
    Privacy is not only a question of guidelines, but of culture within a company. Google obviously takes the issue very seriously …
    Last but not least he shifted the audience focus to the emerging mobile markets of India, China and Africa. One shouldn’t limit oneself to a western perspective on the issue.

    The conference had a good mix of technical and executive level talks.
    Here are my notes on some of them:

    iAds

    According to Steve Jobs a totally new experience of advertising. Emotional as TV but targeted to a persons specific profile.
    Current problems: the ratio of ads to advertising space is very low. Well who wonders given that there are currently only 2 iAds around (Nissan and Unilever). A reason for that is the current restriction that you need a Mio.$ budget to be eligible for advertising on the platform.
    Technically iAds are applications you write in the iAd framework, which is an interesting fact and opens up a new market for software company (and closes one for the classical ad designer with no software skills). Atm Apple is doing most of the ads themselves …
    A much more lightweight form of iAds are iAds for developers (less costly, less impressive).
    That way app developers can ad for their apps.
    Some very interesting legal informations are:
    Since you might not agree with user profile Apple is generating secretly of you to optimally target you with iAds, there is an out option: Go to oo.apple.com/ you disallow personal data collection. The consequence might be worth considering: untargeted ads …
    Certainly one might ask oneself the question, how other ad frameworks fit into this new scene?
    Well, as long as you (as an ad framework maintainer) to not run a mobile platform in parallel you are safe … (read that again!)
    That means apps with integrated admob ads will no longer make it through the review process.

    Mobile couponing

    interesting facts: classical paper couponing has a conversion rate of 0.2% whereas mobile couponing has 9%.
    Have a look at MyMobai if you are searching for a service provider in that area.

    Usability and mobile platforms

    bottom line: there are significant differences between the existing mobile platforms.
    In order to promote discoverability one should stick to the customs of the given platform.
    consequence: read the usability guideline (if there is one)
    consequence2: crossplatform approaches won’t be that successful
    take home message: do not develop for a platform you are not using youself

    Lessons learned from swoodoo

    Good wrap up of iterative, user centric development.
    Prototyping can be easily done with keynote/powerpoint and paper models (have a look at uistencils.com for your favorite UI elements …).
    Actually when developing mobile applications proper usability engineering is key. Users won’t forgive bad design.

    The state of AR

    Gardeya started off with an example of Desktop AR (Tissot) went on to Layar, currently the biggest AR platform.
    It might be surprising, but AR actually sells smartphones (Samsung Galaxy comes with Layar preinstalled).
    Next evolutionary step: form video overlay to video analysis
    Did you know that Google has a patent on street view to replace real world billboards with virtual ones?
    Final statement about AR: kiichi matsuda – domestic robocop

    Staying connected with jwebsocket.org

    good framework, full-duplex efficient real-time communication using a permanent connection.
    Good talk, but to be “web” in the sense of “web scale” the server implementation should provide support to handle 100k+ simultaneous connections.


    Gartner Oracle: Smartphones to dominante PCs by 2013

    January 18th, 2010

    .

    The well known research firm Gartner just published it’s Top Predictions for IT Organizations ans Users for 2010 and beyond, covering developments which definitely affect the RIA market, too. Their key findings are:

    • IT Ownership: ”By 2012, 20% of businesses will own no IT assets”.
    • Cloud Computing: “By 2012, India-centric IT services companies will represent 20% of the leading cloud aggregators”.
    • Social Networking: “By 2012, Facebook will become the hub for social network integration and Web socialization”.
    • Sustainability: ”By 2014, most IT business cases will include carbon remediation costs”.
    • Internet Marketing “will be regulated by 2015, controlling more than $250 billion in Internet marketing spending worldwide”.
    • Mobile Commerce: “By 2014, over 3 billion of the world’s adult population will be able to transact electronically”.
    • Context Aware Computing “will be as influential to mobile consumer services [..] as search engines are to the Web”.
    • User Devices: “By 2013, mobile phones will overtake PCs as the most common Web access device worldwide”.

    Perhaps the most aggressive outlook is the prediction that mobile phones will overtake PCs as the most common Web access devices worldwide by 2013 — Morgan Stanley wasn’t quite that courageous. If we look closely, Gartner predicts that mobile phones will drive the higher number of website accesses “due to the sheer weight of device numbers”, but the “the bulk of page views will continue to occur through larger-format devices”. However: The RIA sector has to get ready for the mobile revolution, existing websites and web-based applications should be designed to be device-independent and their information structure has to be redesigned for mobile phone access.

    Canoonet Mobile

    CanooNet Mobile V2 (announced for 2/2010) demonstrates a successful redesign of a content structure for mobile access: No information should be positioned more than 3 clicks away from the user.


    Canoo at the Mobile World Congress 2009, Barcelona

    February 26th, 2009

    How did we end up here?

    Before discussing Canoo’s attendance at MWC 2009, it’s worth reflecting what brought us here. The story arguably began at Canoo’s Code Camp 2007, where one of the teams thought they’d try out something called “JavaFX”. At that time an early version of JavaFX had just made its debut at JavaOne ’07 and the guys were keen to take the technology for a test-drive. And voilà… MusicPinboard was born. Little did we know at the time that the resulting, appealing little application would result in Sun Microsystems contacting Canoo in October 2008 to ask if we’d like to participate in the “November” launch of the first official version of JavaFX. A rewrite of the app ensued (because official JavaFX differed significantly the ’07 version in a number of respects) and the launch took place slightly later than originally scheduled, in December, at an invitation-only event in sunny San Francisco. The application demo’d by Canoo at this event struck a chord with the attendees and Canoo was subsequently invited to create a mobile version of MusicPinboard to coincide with the launch of a mobile version of JavaFX.

    About the MWC

    The Mobile World Congress is the biggest of its kind, featuring a four-day exhibition of over 1200 world-class firms, as well as technical sessions and keynotes from CEOs of Microsoft, Vodafone, Nokia, to name but a few.

    It is therefore significant that Sun should choose this particular venue to launch its mobile variant of the JavaFX, entitled – logically enough – JavaFX Mobile. Equally significant was the presence of Sun top-executives, such as Messrs. Eric Klein and Param Sing – VP and Senor Director of Java Marketing respectively, as well as Executive Vice President of Application Platform Software Anil Gadre. Also at the Sun booth: Canoo senior developers Mike Mannion and Alberto Mijares.

    On Display at the the Sun Booth

    Naturally enough, all of the technologies on show at the Sun booth related to mobile technology in some way or another.

    Sun booth at the MWC 2009

    For example, there was a demo of the Glassfish Mobility Platform, which, by means of a connector architecture, enables the enterprise to sync mobile devices with potentially any enterprise application. Sun streaming TV technology was also on display as was LWUIT (Lightweight UI Toolkit) – a UI toolkit library for Java ME. But there can be no doubt that most of the booth’s emphasis was on JavaFX and JavaFX Mobile, with a range of hands-on demos on show. These included:

    • A mock security video monitoring system, which constantly looped through a scenario in which a bunch of crooks attempt a break-in at the Sun site. This demo was so impressive, in fact, that a number of people came to the stand to ask when the “security product” would be available!
    • A very attractive mock social networking app for sharing restaurant and location information with buddies;
    • A cute game involving bunnies, which we presume was designed to suggest that JavaFX is suitable as gaming platform;
    • Canoo’s MusicPinboard application in both desktop and mobile forms, which Mike and Alberto used to describe the use of JavaFX tools Production Suite and NetBeans 6.5

    On show: MusicPinboard Mobile

    As previously announced Canoo was in attendance to demonstrate its recently created MusicPinboard Mobile application – an application created using the first official version of JavaFX Mobile. Around forty detailed demonstrations were given over the four-day period. In addition and in response to the questions from the attendees, Mike and Alberto also talked in detail about how the application was realised using the JavaFX Production Suite tools and the JavaFX plug-ins for the NetBeans IDE.

    Here is the application running from within the NetBeans IDE:

    The technical challenges encountered during the development were also freely discussed on the Sun stand, as were issues with the current version of the runtime, which sits atop Java ME on the hardware.

    Here is the application running on Sony-Ericsson’s high-end Xperia device:

    Most Frequently Asked Questions (and who was asking them)

    Without a doubt, the most frequently asked questions were the following:

    • What is JavaFX?
    • What is the difference between JavaFX and JavaFX Mobile?
    • Concerning JavaFX development: What kinds of tools are available today and what is the quality of these tools?
    • When will JavaFX Mobile be deployed to commercially available devices in the way that Java ME is today?
    • How well does the JavaFX Mobile Runtime perform and what is its footprint?

    We (Canoo) will not attempt to answer these questions in this post, but will address them over the coming weeks and months as yet more experience is gathered and whilst Sun continues to actively improve the platform.


    Above: Canoo’s Alberto Mijares (center) engaging with one of the many parties interested in JavaFX

    As for who was asking these questions: The vast majority of the people who witnessed our demonstration were clearly strategic decision makers in the CEO/CTO bracket. Some folks came from research departments and even some software developers (people like us!) made it to Barcelona too.

    Independent Opinion on the Stand Greatly Appreciated

    When Mike Mannion delivered an (arguably) sobering evaluation of the state of JavaFX in a talk at JavaOne in 2008, the last thing he expected was for Sun to give him a call and request a repeat performance. Yet Sun DID call him and he DID give his talk a second time (clearly because, even at that time, there were also many positive things to say about JavaFX in addition to the negative.)
    Now, when Sun is officially launching JavaFX / Mobile, why would Sun be giving an opportunity to independent third parties to express freely their opinion about a brand-new (read: immature) technology? It comes down to this: Sun receives constructive feedback, reenforces its credibility with potential users of the technology and, at the same time, demonstrates its confidence in the technology’s future. It is therefore perhaps surprising that not more organisations take this open and enlightened approach.

    Win-win-win

    We can testify first hand that Sun is a company that embraces open discussion – not just open source – and (constructive) criticism of its technologies. The response from the public made it perfectly clear that this is a win for all parties; in particular, potential client get an unabridged opinion, whilst Sun reenforces its credibility. And Canoo? Canoo looks good too ;-)

    Mike meets Executive VP of Application Platform Software, Anil Gadre
    Above: Canoo’s Mike Mannion (left) with Sun’s Executive Vice President of Application Platform Software: Anil Gadre.