Tabs on Android

Using a tabbar, either at the top or bottom of an interface, is a typical design pattern used in apps to navigate between segments. This is used by the Android Twitter client for example. The typical way to implement this is by using TabWidget, TabActivity, TabHost and friends. Each tab is populated with whatever activity you want and all is well.

There is a problem with this approach however. If you start a new activity the tabs (area A, B, C) all disappear and this is not always what you want. Sometimes what you want is to keep the tabbar around and have an individual backstack for each of the tabs.

Typical tab layout

Typical tab layout

I’ve published an example on github that shows how you can get the best of both worlds. It explains how to keep an individual backstack for each tab, but also how to start activities that break out of the tabs as is the traditional way on Android. The Back button still works and you can also programmatically navigate back. The behavior of back is changed to respect the backstack of each individual tab.

If you want to try it out yourself I’ve compiled an Android package for you. Navigate to http://bit.ly/stacksintabs with your Android device and install the .apk to check it out.

Navigation in the example

Navigation in the example

The design is very simple. I still use TabWidget, TabHost and TabActivity (layout here) – but instead using normal activities for each tab, I subclass FragmentActivity – and build a stack of Fragments inside each tab. The gist of the code is in the addFragment(…) function

To launch a new fragment inside a tab (area D), see the launchNewFragment() function, and to see how you break out of the tabs and launch a new activity (area E) see the function launchNewActivity(…)

The fragments and activity I use are just examples, the point is that you replace ExampleActivity and ExampleFragment with you own classes.

My initial approach at solving this problem was using Fragments exclusively, but since nested Fragments are not supported on Android I gave up.

I hope this helps some of you – it’s all available under a BSD license. The example requires API level 7 and uses the Android Support library v4. Comments and contributions are welcome. Btw: I’m also working on a comparison between QML and Android XML where I compare pros and cons, so stay tuned for more :)

New office and new employee!

Nothing is like starting the new year with blank sheets of paper and color crayons! OK, Norwegian proverbs might not translate that well, but here we are: A new year, a new office, and a new employee (me)!

New Employee Cava

I can totally get used to lunches like this!

My name is Henrik Hartz, and I joined Espen and Marius January 2nd this year after working 7 years at Trolltech and Nokia. For the first week and a half I have been getting busy with existing projects while Espen and Marius are pushing new frontiers – for the time being focusing on an Android project.

Aside from 50% growth, we also moved to a new office – literally across the road from the old one. The new place is a lot larger – the three of us share an office – while we have a lunch-room (with a red couch and gaming system) and extra offices to spare. We want to grow even more this year.

After moving in – the place was in a bit of a shoddy state..

before we got our shit together

discombobulated...

After a quick stop at IKEA, we got some new office furniture to get us ready for a busy New Year!

espen building a bookcase marius building a coat stand david and alexandra helping out marius doing assembly

After organizing and cleaning up, we’re ready to take on the new year

marius can't stop hacking troll bowl lunch room coffee

 

Share

Qt Developer Days 2011 in Munich

We’re back from Qt Developer Days 2011 in Munich, Germany. What a great show! For those of you who werent’ there here is a small recap of what happened from our perspective. First, some pictures

This slideshow requires JavaScript.

Both Marius and I were presenting in Munich. Marius dissected the code of several of our apps, and explained how QStateMachine makes your life easier. The talk is available here:

I talked about Necessitas, Qt and Qt for Android and basically explained how you publish Qt apps on the Android market. That talk is available here:

Now we gotta work to catch up on other projects!

Share

Qt mobile platforms poll

We in Cutehacks are trying to gage the developer interest in Qt for Android and Qt for iOS. Thank you for taking the time to answer this short poll.

Update: added nice charts so you can see the results so far.

Update: the poll has ended. A total of 344 people answered our questions. Thanks to everyone that participated!

You can also play with the interactive charts here.

Share

Cutehacks 1st year – An executive summary

Time flies when you’re having fun, and we’ve had lots! It’s been year since we started Cutehacks. Here is a short summary of what we’ve achieved, and what we’ve learned – the good stuff and the bad stuff.

For the executive brief, check out the video below.

Achievements

  • Formed a legal company
  • Got an office and bought hardware
  • Got an accountant, lawyer, designer etc.
  • Published 4 Symbian apps
    • Yr.no for NRK
    • Telenor Faktura for Telenor
    • WiMP for Aspiro
    • Fly for ourselves :)
  • Made our Symbian apps run on Maemo, MeeGo and Android as well
  • Contributed a bit to Qt for Android
  • Created a UI prototype on Win/Mac/Symbian for a client
  • Went to Qt Developer Days, Qt Contributor Summit, MeeGo Summit, Akademy, SEE, etc.
  • Consulted for ad-agencies and printing companies
  • Stayed at five star hotels – for FREEEEE
  • Got 3 minutes on national TV
  • Got mentioned on lots of mobile sites
  • Started a tech-startup-network-club-thingy
  • Got tattooed
  • Got paid

Three things we’ve learned

“If you set yourself goals, you will actually reach them”: When we started Cutehacks we said that an ideal project for us would be to develop the WiMP client. One year later, we actually achieved that. We’ve also worked towards getting our apps running across multiple platforms – this is also starting to happen.

“Ask and you may receive”: We’ve gotten free hardware, new projects and invitations to talks – simply by asking for it.

“The only constant is change”: Wow, this one has definitely been true for us. We didn’t see 2/11 coming – but once it did, we’ve simply had to adjust and move on.

Some advice for software startups

  • Use LinkedIn
  • Use Twitter
  • Use YouTube
  • Use Google Apps (Mail, Documents, Calendar)
  • Use Github (or similar)
  • Use WordPress (or similar)
  • Use a professional accountant
  • Use a professional designer
  • Present at conferences
  • Say Yes more than No
  • Build up your IP
  • Act professional
  • Use your network
  • Ask for things
  • Get an office
  • Always look for new projects
  • Experiment with new technology
  • Get signed contracts
  • Always go to a meeting prepared
  • KISS
  • Do it

Share

Cutehacks at the Qt Contributers’ Summit

A big ‘Guten Tag!’ from Berlin and the Qt Contributor’s Summit! We’ve already attended the pre-summit Qt for Android meeting and are now at the Café Moscau where the actual summit is taking place.The place is buzzing with sessions and discussions about present and future Qt development. About half the people present are non-Nokians and all are enthusiastic and engaged in shaping the future of their favorite cross-platform toolkit. There are people walking around with various Android devices and iPads running ports of Qt.

So far it’s been a fun, interesting and productive event. It’s a great venue and it’s all been extremely well organized, including working wifi (!) and free drinks. We will stay here until the end of the event on Saturday, so if you’re in Berlin and want to talk to us, give us a ping or look around for the Cutehacks logo.

Share

Cutehacks targeting Android, Symbian and more

Here is a video of two apps developed by Cutehacks: Yr.no and Fly running on Android 2.2 and Symbian. These native apps were originally written for Symbian but run great on Android as well:

Using Qt for Android (more specifically Necessitas and Ministro), the amount of code changes we had to do were minimal. This shows the power of Qt – it truly is cross-platform. Too see these apps running on MeeGo and Maemo as well – check out this video.

None of the apps above are available in Android Market yet. Be assured we’ll tell you when/if that happens :)

Share