Background service with hybrid app

4 posts, 0 answers
  1. David
    David avatar
    2 posts
    Member since:
    Feb 2016

    Posted 02 Feb Link to this post

    Hi, there!

    We're planning on developing a mobile app and we haven't decided on going hybrid, C# (shared code) or purely native. We need this app to have several views and also have a background service to fire alarms that will be stored in our client's database, not locally in the phone.

    Do you think we can use the hybrid approach? Or should we pick any of the other two ways?

    Thanks a lot!

  2. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 05 Feb Link to this post

    Hi David,

    Thank you for contacting us! The described scenario can be achieved with all of the mentioned approaches. That being said, it is more a question of the benefits and drawbacks for each of the solutions in terms of time, efforts, performance and specific skills involved.

    Depending on your decision you can go with:
     - Hybrid app or Cross-platform app using Telerik Platform and JS and HTML

    Hybrid apps are built leveraging Cordova (PhoneGap). Cordova framework is using the browser's layout and rendering engine to display the UI of the application. NativeScript is using the native platform default rendering and layout engine to display the UI of the application. This means that the applications using NativeScript framework are exposing exactly the same UX as natively written applications.

    You can also download a whitepaper on Mobile Developer Guidance: Hybrid vs. Native which can be helpful in making development decision.

    If you decide to go with a hybrid approach, in Telerik Platform that would mean that you will build an app leveraging Cordova. In Cordova native device functionality can be accessed through plugins. Please check Cordova Verified Plugins for more details. The topic on Developing Your Hybrid Mobile App with AppBuilder may also be helpful.

    On the other hand, the native app development is available through the https://www.nativescript.org/ open source project. It enables developers to build native apps while allowing full access to the native APIs of the devices themselves. For more information, please check the posts on:
    http://www.telerik.com/nativescript/faq
    http://developer.telerik.com/featured/nativescript-a-technical-overview
    http://developer.telerik.com/featured/getting-started-nativescript
    http://developer.telerik.com/featured/nativescript-works/

     - Native apps - using our native suites for each of the platforms writing it on Obj-C/Swift, Java and C#.
    http://www.telerik.com/ios-ui
    http://www.telerik.com/android-ui
    http://www.telerik.com/windows-universal-ui



     - Cross-platform app - using our UI for Xamarin suite writing it on C# using Xamarin Forms platform
    https://xamarin.com/forms
    http://www.telerik.com/xamarin-ui


    If you have any further questions do not hesitate to contact us!

    Regards,
    Tsvyatko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. David
    David avatar
    2 posts
    Member since:
    Feb 2016

    Posted 05 Feb in reply to Tsvyatko Link to this post

    Thanks for your reply!

    My biggest doubt was the alarm system, since I'm not sure if background services can be built with non-native technologies, I have read some things and people say it can, but it has a timeout, which means it stops after a while, something we can't afford.

    Can we go hybrid with a background service that doesn't stop?

  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 10 Feb Link to this post

    Hi David,

    Regarding Xamarin solution - you can find more information in their help resources - here. If you decide to go with Telerik Platform you have different options for running background services. However, I am not sure what you mean by alarm. If you want to send push notifications to your users, you can definitely do that even when the app is running in the background. You can have a look at the Telerik Platform Backend Services Push Notifications documentation.

    In a Cordova-based hybrid app, you can use the Push Notifications plugin to handle push notifications coming from a remote server. You can also have a look at the Local Notifications plugin to see how to trigger notifications from your app. You can also check the Pushwoosh notifications plugin. Note that all plugins come with a ready-to-test sample application which you can quickly run and test in your Telerik Platform account.

    We also provide a PushNotifications plugin for NativeScript which API and sample app you'll find here.

    Apart from that, there are multiple plugins for Cordova which provide access to the native APIs. For instance the PowerManagement plugin offers access to the devices power-management functionality, the Background Service plugin for Android allows you to create a background service and the iOS BackgroundFetch plugin provides an API which wakes up your app about every 15 minutes (during the user's prime-time hours) and provides your app exactly 30s of background running-time.

    I will be happy to provide you with more specific information if you decide on an approach and if you can further elaborate on your requirements.

    Regards,
    Tina Stancheva
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner