I'm building a Nativescript-Angular (Android and iOS) app that should guarantee uploading zip files to a server. App should check for new zip files every 4 hours. Uploading can be deferred.
I understand that the best way to the above job in Android is to use the WorkManager, because the job execution is guaranteed, and the work can be deferred (doesn't have to happen now, but it will surely happen in the future).
How can I use Android WorkManager in Nativescript?
I followed this tutorial to create an android service using nativescript, and the corresponding nativescript android background service example, but is uses jobScheduler instead.
For the uploading itself I'm currently using Nativescript Background Http Plugin that uses NSURLSession with background session configuration for iOS; and alexbbb/android-upload-service - but it's not a good choice because I have to constantly check for new files every 4 hours and upload them to a server.
Any idea on how to implement and use Android WorkManager in Nativescript?
Thanks,
Related
I have an app running on IOS (Swift) using the DJI mobile SDK. At the moment, I still need to use the dJI GO app to determine if the aircraft is ready for takeoff (not in a no fly zone, compass is calibrated, etc.). Is there a way to see those issues from the SDK?
If you are using the iOS UXSDK this is already built in using class DUXPreflightChecklistManager and you can find sample code here: Mobile-UXSDK-iOS >DULPreflightChecklistManager. If you do not want to use the UX iOS SDK and want to build your app purely from the iOS SDK then you will need to find each api for the features included in a preflight and build your own logic to have them do a check and throw errors at the startup of the RC and aircraft. For example: class DJIBattery, flyZoneManager or isFirmwareVersion:newerThanVersion
Is there a technical limitation why Xamarin does not support updating the application without publishing to the app store? Javascript cross-platform mobile development frameworks like React Native or Cordova can do this.
You are comparing Apples to Oranges in a sense. When it comes down to Native Development, Xamarin is a framework that allows you to do Native Development via Wrappers: https://developer.xamarin.com/guides/cross-platform/getting_started/introduction_to_mobile_development/#How_Does_Xamarin_Work
Because of this, you would do the same workflow as if you were pushing an update to your Native Android/iOS application(Programmed in Java/Obj-C respectfully).
Whereas on the other side with frameworks like React/Cordova, they have mechanisms to inject content via pulling from a server-side service. This is explained pretty clearly in a third party cordova project that does this very thing:
https://github.com/markmarijnissen/cordova-app-loader
However if you made a local Cordova application that had no connection to a server-side service and you needed to update it, you would most likely have to follow the same procedure of uploading the new .ipa / .apk with the new assets/code/etc as it would be a packaged stand-alone app.
That's because all the code is in js files that can be downloaded an replaced out side of the ARM binary. Xamarin's code is the binary. Also, if your code is in the App Store, you should be updating through the store. This is less of a limitation of Xamarin (since you can't do this with native obj-c apps either) and more of a "pro" for the js apps.
As a side note, if you go with Enterprise deployment instead of App Store, you can update whenever you want (because you completely control the deployment mechanism).
I have to develop an app for iOS and Android and it has to be able to run embedded in existing apps. I would usually do this with Cordova since it takes care of the multiple platforms and it is easy to embed in an existing app by creating a Cordova WebView.
Since this app is making heavy use of animations I have been playing around with NativeScript in order to avoid the bad performance of this kind of UI running on a WebView.
The problem is that it seems that embedding a NativeScript app in a native app is not straightforward at all. I have found this https://groups.google.com/forum/m/#!msg/nativescript/4kDFcX6gtxA/vdjruLLVBQAJ Is this still true? Any suggestions or ideas on how to accomplish this?
You can check this sample for iOS:
https://github.com/NativeScript/sample-ios-embedded
We will provide soon similar for Android
[UPDATE] Here is how to use {N} in existing Android app:
https://github.com/NativeScript/sample-android-runtime-embedded-POC
I have just started using Titanium and was wondering if the apps I develop would be sent to Titanium server for compiling? Can anybody clarify? Thanks in advance.
You don't need to compile the apps on any of the Titanium servers. You can compile the apps from within Titanium Studio. When testing the app on the device, Titanium Studio automatically generates the ipa file and apk file for respective platforms
Edit:
Using Titanium, developers can create an application writing Javascript and calling Titanium's APIs. The Javascript is then interpreted at runtime. The application's UI then becomes completely native. There is no web UI in your app since the native Titanium APIs take over control of all UI needs. Titanium runs application's JavaScript using one of two JavaScript interpreters' JavaScriptCore on iOS (the interpreter used by Webkit) and Mozilla Rhino on Android.
The Javascript calls to the Titanium API are mapped to native code in the Titanium framework and generate native components. Events in those components are sent back to the code in Javascript where we can handle them
I'm developing a mobile app using ASP.Net MVC to generate HTML 5 pages. The HTML 5 pages will use jQueryMobile's loadPage to make calls to ASP.Net MVC to load pages into the DOM. Then it will use jQueryMobiles's changePage to make the page active in the DOM based on the user's interactions with the app. Calls to the MVC app will invoke different webservices to retrieve the source data to construct the HTML.
We plan on using PhoneGap with the app so we can submit the finished app to Apple and Android stores. My app does not need to interact with a device's native functionality (contacts, geolocation, etc.) Since we do not need to interact with the actual device's OS (except to make jQuery ajax calls to MVC app), then is PhoneGap really needed? Is the approach I've described above an appropriate way to make a web app viable on mobile devices?
Since my application is asp.net mvc and will be hosted on my servers, what gets sent to the Android and Apple stores? Is this where PhoneGap comes into play? Does PhoneGap create an executable of some sort that is submitted to Android and Apple stores? Then this executable is downloaded onto client devices? I'm assuming the executable will then make calls out to the MVC site via URL to retrieve the application HTML?
Am I looking at this correctly? Thanks for your help.
Phonegap (or some substitute) is not quite required but very helpful to create an app package from your HTML/JS/CSS source. Phonegap doesn't create the executable (your IDE does that) but is a framework of Java to JavaScript functionality (making it possible to run Java code from your JavaScript).
Phonegap basically wraps your HTML/JS/CSS site in a webview so that your code can be interpreted by the device's browser (sometimes in a more sand-boxed manner than running the browser normally, for instance pre-iOS-5 webview instances do not get the Nitro JS engine so they run slower than websites in the Mobile Safari browser).
You can create your own webview if your site is so simple it doesn't use any of the other Phonegap functionality but since it's already baked into Phonegap and the device won't have to download Phonegap. You might as well use Phonegap.
Phonegap Build (https://build.phonegap.com/) is a program you can purchase to have your app packages built and submitted to Apple/Google/RIM/Windows app stores. Generally you just use your own IDE to do this however. For instance to create an iOS app you have to use a new Apple computer (you have to have the latest OS version to build the latest versions of iOS packages). iOS app packages are created in XCode, and Eclipse IDE is a very common environment to create your Android app packages: http://developer.android.com/sdk/eclipse-adt.html
I noticed you said you are using $.mobile.loadPage() to load pages into the DOM and $.mobile.changePage() to navigate the user to those pages. If you just use $.mobile.changePage() then it will automatically grab the page with loadPage(). If you are using loadPage() to pre-load content then check-out jQuery Mobile's prefetching abilities: http://jquerymobile.com/demos/1.1.0-rc.1/docs/pages/page-cache.html
UPDATE for 2014
I have recently built some applications using Cordova 3.5 and the build process was very much so simplified. The package building process is now managed via your system's console and everything from installing plugins to rebuilding an application package is much easier.