I'm wondering it's possible to identify android device by web app running on mobile web browser? And this solution have to still working after change or upgrade web browser on this phone.
My second doubt is web app can working offline on phone showing PDF presentations saved in local storage (disk). When I have internet connection I can manually sync presentations (some are removed and some are downloaded).
If PWA app can work like I described above or in this case we need to use (hybrid) mobile app ?
PWAs allow to cache assets and make them available to the users even when they are offline. There are some functionalities that only Native Apps have (eg. access to a device contacts), but they are very close under many other aspects.
I wrote an article about Service Workers and caching strategies where I explain how to cache static assets as well as HTTP GET calls. It is part of a series about PWAs, so you might find it useful to get more insights about this technology.
Have a look at the website what web can do today to have a list of WEB APIs currently available:
I do not know the detail of your requirements, but maybe you do not even need to implement an hybrid app and simply create a PWA.
Related
I am creating a React JS web app which will eventually be converted to a PWA so that the users can install it on their mobile devices. Now the client ask to find out a way to push these PWA apps to apple store and google store. So my query is whether we have tools for converting the Progessive Web Apps as apk or ipa files so that we can put them to apple store or play store.
I googled a bit and is right now confused because some say it is possible, some say not possible in Apple store. I also saw some tools like PWABuilder, but I am not sure which one is the right one to use and whether we can publish a PWA app to the app store and play store.
Any help on this will be very grateful.
Thanks
While it is possible in both cases, publishing a PWA on the Apple Store is an incredible difficult journey, because Apple engineers try to build obstacles all the way long. This is by decision as Apple is making profits from its app store and PWAs would indeed subtract some of these gains. This is also the reason why Safari, as browser, is incredibly behind the other competitors in supporting PWAs APIs (PUSH API for example, as they promote their Apple Push Notification Service (APNs)).
Long story short, I would concentrate on Google Play Store, where you can publish a PWA after having wrapped it into a Trusted Web Activity (TWA), allowing Chrome (v72 or later) to run a website in fullscreen mode without a browser toolbar within an APK (Android Package). You can find further details in this tutorial to publish a PWA on the play store.
You could use Capacitor to create a native App.
It is newer than Cordova.
Here you can see the Stackoverflow TagTrend: Capacitor vs Cordova
... or wait some month. Sooner or later you will get PWAs into the Apple Store. I don't think they are able to stop this process.
I published my pwa to google play store and apple app store. I used App-bound Domains for ios and Twa for android. I think at this time to simple to publish some pwa to appstore.
I'm building an application that allows users to upload multimedia files they create (audio, video, graphic) via my web frontend, and then other users can stream/download the files to their phone using my mobile app. I'm building the mobile app with react native. The problem is with the android platform-- when the files are downloaded, they show up in the Downloads folder, which means they can be copied, moved, and opened from other apps.
Since the file contents are copyrighted, I need to find a way to
prevent these files from being listed in the Downloads folder
and / or
prevent other apps from opening them.
Apps like Spotify and Netflix manage to do it (e.g. if you download a playlist from Spotify, you can't see them anywhere else on your phone). I believe some kind of encryption/decryption scheme is involved. But I don't know enough about it. Would appreciate any insight on how to go about this.
As Luke says, there is no 100% protection, but usual approach is to encrypt the files and to use a DRM system to manage the secure transition of the key from the server to the client Android device.
Android devices (generally) come with widevide DRM built in and this is probably the most common one used, but the system supports other DRMs also and device vendors may add different ones.
If you are prepared to accept a less secure encryption, but one which may be good enough for your needs, then MPEG DASH includes a 'clearkey' option which ExoPlayer supports. If you do go this way it is worth checking on the latest ExoPlayer status as this feature is being worked on at the moment:
https://github.com/google/ExoPlayer/issues/3178
Application cache as a means of creating offline browser apps has been deprecated. The current way to make an offline web app is to use service workers.
Service workers allow you to bootstrap all network requests and provide content for them. Since service worker can run even when user closes the tab, it can provide cached content when internet temporarily doesn't work.
However when I got interested in offline web applications, it was because I hoped to use even when I have permanently no access to internet. I created simple offline app, but it does not work when I close and open the browser — I get message that page cannot be loaded.
Is there a way to make service worker offline app work even after browser is closed and re-opened? If not, are there any planned standards for this? It would be very valuable to mobile users.
Can an offline JavaScript app using service workers work after browser restart?
Yes, it can, provided it's cached all of its resource previously. This example goes through the steps of ensuring that.
The reason it can is that when you navigate to the URL that the service worker is registered for, the cached copy of the service worker is activated and it's given the opportunity to satisfy network requests for the app. So if you've cached everything, and you satisfy all of the requests by handling the fetch event, your app can be entirely offline.
There is a great deal of development in the area of service workers. Chrome is taking the lead, but Firefox follows closely. IE support is negligible however.
You can see the W3C working draft. For browser support, check e.g. here.
I also suggest taking a look at Nolan Lawson's pokedex.org application, it is an offline-capable web app based on service workers.
I have a Tomcat based server which serves as a Websocket end point (used javax.websocket) for my web based JS app. I am serving out json based data (queried from my database) via the web sockets. I am not using websockets to serve out HTML/JS pages.
Now we are building a native mobile app of our JS web app. There doesnt seem to be good native support for Websockets on Android and ios.
I would like to keep the server code base common to both JS client and the mobile client.
What would be your suggestion for such a situation? Write a different server for mobile clients?
I found this http://www.elabs.se/blog/66-using-websockets-in-native-ios-and-android-apps. They suggest SocketRocket for ios and https://github.com/TooTallNate/Java-WebSocket for Android.
I have never heard of these people / companies. Not sure of their antecedents and if their apps are bug free.
Any suggestions would be welcome.
I'm not sure if this is the answer you are looking for, but I tried this once, and decided to use a webpage that uses the websocket. Each app will display a webview accessing the page. All recent iOS SDK versions support this, but only the newer (4.4+) Androids will.
If you do not want to use webviews, I recommend Tavendo Autobahn for Android. I had a problem that my server's websocket would disconnect all the time. I had to implement a reconnection routine every couple of seconds on the app.
Hope it helps :)
I'm using this library on android for websockets https://github.com/codebutler/android-websockets
Works good with Spring WebSockets.
Sorry for messy answer, I'm in hurry, write in comments if u have questions
I want to build and application through which an user can input some settings and the application will start a background service to perform some tasks based on those settings.
I want to run the application and the background service only in the Simulator (I know that it requires "certified" mode for running a background service, but I am not thinking right now for posting the app on Firefox Marketplace).
Can someone provide me with some links or tutorials on how to build and run a background service on FIrefox OS platform? Can anyone also explain how to communicate between the background service and the application? (I have search the MDN and on google, but no luck).
Also, is there some way for application (regular app or background service) to listen for notifications from a server?(I am looking for a method in which the application does not pool, but is notified by the server).
Thanks,
Tamash
Can someone provide me with some links or tutorials on how to build
and run a background service on FIrefox OS platform?
This is planned of a future version of Firefox OS. See "Background services" at https://wiki.mozilla.org/Webapi
Also, is there some way for application (regular app or background
service) to listen for notifications from a server?(I am looking for a
method in which the application does not pool, but is notified by the
server).
This doesn't seem to be implemented yet. See https://wiki.mozilla.org/Webapi and https://wiki.mozilla.org/WebAPI/SimplePush
The wiki page above is out of date - though it hints at what's coming.
Currently the RequestSync API has landed - it allows scheduled wake-ups for synchronization purposes. This is not an always-on background service. It's planned to ship in the 2.2 release of Firefox OS.
RequestSync is not yet documented on MDN but the implementation bug is here: https://bugzilla.mozilla.org/show_bug.cgi?id=1018320
RequestSync is a partial solution until we have full background synchronization through Service Workers.
Service Workers are in the implementation stage now: https://bugzilla.mozilla.org/show_bug.cgi?id=903441
Draft documentation on MDN is here:
https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker_API