Native, Web and Hybrid Apps – Building and Testing

There is a mobile app for everything nowadays, but how are those apps built?

There is no universal rule to help you decide whether to build native, web, or hybrid apps, but there some factors to consider before deciding. Once the app is ready, the testing part starts.

The approach you choose depends strongly on how the app is build.

Let’s find out what could be the best choice for your app!

What are native apps?

native-app

Native apps are applications build for a specific operating system because they are coded entirely in a specific programming language, e.g. apps built for Android cannot run on iOS and vice versa. This enables developers to use most or all the features and core functionality available on that one platform. It is usually Objective-C for iOS and Java for Android. All the information and the data is stored into the device, making the app fast and independent from external servers. Native apps work also if the device is offline which will give users a responsive experience, unlike web and hybrid apps, which need the device to be online to function properly.

Each platform offers developers their own development tools, interface elements and standardized SDK.

Best practices to write native apps

If you decide to build a native app, chances are that you will need a different team for each platform you want to develop for, as developers usually specialize in one platform.

If you have already built one app for either Android or iOS, it will need to be completely rewritten in the native language of the target platform, e.g. if you have an Android app, that your want to make available for iOS as well, the app needs to be rewritten in Objective C. If no app already exists and the target markets are both Android and iOS, the development process will be more expensive, because both apps need to be created from scratch.

The apps will also have to be maintained by experts of each platform.

Benefits of native apps:

  • Fast and reliable
  • Most responsive experience to users
  • Access to core device capabilities e.g. camera, microphone, compass, accelerometer and swipe gestures
  • Use alerts in form of push-notifications

Testing native apps

Testing is an important part of developing any app. With the help of developer tools and SDK, writing automated tests for native apps is relatively easy. With frameworks like Appium and the platform SDK you can easily find elements to write your tests.

What are web apps?

web-app

Web apps are nothing else than mobile-friendly websites, and since those websites are specific for mobile devices, they are called web apps.

Web apps are commonly build using CSS, HTML5, and JavaScript and can be reached by typing in a specific URL into your browsers. To “download” these apps, you will have to create a bookmark and add it to your home screen.

Best practices to write web apps

The best way to build web apps is to keep them as light as possible, because mobile users wait just an average of 4 seconds for website to load. If it doesn’t, user will just browse back to search result and never come back.

Benefits of web apps

  • No need to develop an app
  • No need to download and install an app
  • Can be accessed from any browser

Testing web apps

Testing web apps is easy if you already have some experience in website testing. To locate elements to include in your test scripts for test automation, you can simply use the browser page inspector, that is already built in most browsers. For every test case, you will only need one test script, which will work on every platform, thanks to the cross-platform programming languages in which the web app is written. The main difference between testing native/hybrid apps and web apps is that with web apps, you will want to test on different browsers and not on different devices. Some code can be translated slightly different on different browsers, which can consequently display some parts of web app incorrectly.

What are hybrid apps?

hybrid-app

Hybrid apps are somewhere between web apps (mobile websites) and native apps. You will have more functionalities available than with web apps, and it is cheaper (and quicker) to build than a native app.

Unlike native apps, hybrids don’t require separate versions for iOS and Android. Hybrid apps use cross-platform elements like CSS, HTML5, and JavaScript, which are the same languages used to build web apps. Native code can be added to allow the app to use core functionalities of the devices. Those portions of code will need to be re-written for each platform in their native languages.

Most of the time it is cheaper to develop a hybrid app if you want a simple and mobile website oriented app. However, the costs rise exponentially while introducing more complex, native-like capabilities. In simple terms: the more you want your hybrid app to behave like a native the more it’s going to cost.

Best practices to write hybrid apps

The whole hybrid app can be build as if was a mobile website (web app) and then you would use tools like Cordova or PhoneGap to wrap the code and “transform” it into an app. At this point, you can add native code specific for each platform to tap into core functionalities to add specific features.

Benefits of hybrid apps

  • Apps are cross-platform thanks to cross-technology like css, html5 and javascript
  • Only small portions of native code need to be re-written to adapt for different platforms
  • If a feature is added, all of the apps will benefit, without much extra effort

Testing hybrid apps

If your hybrid app is only written in CSS, HTML5, and JavaScript, you can test it like you would a web app: you will only need one test script for each test case and it can be run on all platforms.

If your hybrid app has some native code too, every test case will need to have multiple test scripts, written in the native language of the platform you want to test on.

Choosing the right type of mobile app

Native Apps Web Apps Hybrid Apps
Easy to build
Need different version for each platform ✓/✗
Easy to do testing on ✓/✗
Works also offline
Can use device’s sensors and gestures
Needs test scripts for each platform
One test script can be used on all platforms ✓/✗
Needs extra software to identify elements
Uses browser inspector to identify elements
Needs testing on different browsers
Needs testing on different devices

Conclusion

To summarize, native apps are more expensive to build than hybrid apps, but it’s not always the best solution. Hybrid apps are easier to maintain and if a new feature is added, all of the existing apps for different platforms will benefit. Web apps are just your current website which requires some coding to become mobile friendly.

If your app uses device functionalities such as GPS, gyroscope, phone contacts etc, a native app will be better suited.

If you already have already a mobile website and you just want to be visible in the app store, a hybrid app is your best choice, to avoid spending too much money and time into building an app.

Also keep in mind: web and hybrid apps only work online, as they retrieve information from the web and only store minimal information on the device

The app you will build depends on strongly on your requirements, your budget and time you can invest.

Written by

Ely Hechtel

Topics

App testingMobile testing

Categories