hardware back button on Android is stopping the app - angularjs

I making mp3 player with ionic. I use "cordova.plugins.backgroundMode.enable()" for play music in background if close the app.
But when press hardware back button on Android is "stopping and closing" the app instead of just "closing and go back".

You have to use something called Android Services.
From the docs:
"A Service is an application component representing either an application's desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use."
Here's the excellent official guide to using services to get you started: http://developer.android.com/guide/components/services.html
Here's a good tutorial on building an audio player: http://www.androidhive.info/2012/03/android-building-audio-player-tutorial/
Here's a video tutorial for building a streaming music player: http://www.youtube.com/watch?v=LKL-efbiIAM

Related

Video streaming including application overlay components

I want to make a react-native app having the capability of video streaming from a mobile app to a connected browser user. On top of that, I want to overlay some application components so connected users can see video streaming as well as some of the application UI.
For an example take a reference of the below-given image. Here, video streaming is running in the car showroom and there are a few app components shown as an overlay of the video like an app menu and a car image.
I want to achive same functionality and using VideoSDK platform for video streaming service.
So far I have created react-native app and able to stream video through camera to the connected browser user.
Next, I want to add my app menu on top of the video as per the image and therefore i am thinking screenshare with combination of video sharing is way to go.
The above image is the actual implementation using video SDK in the browser but as you can see screen share window is opening in a totally different context which is not the expected implementation.
Can someone suggest how can I achieve the functionality of video streaming having the capability of app overlay components?
I have reviewed your requirement and I am glad to inform you that we do have application with same requirements, for further discussion and demos can we connect over mail i.e. karan10010#gmail.com

Is there any way to stream music in the background with Ionic framework?

I'm developing an Android app using Ionic for music streaming, like a personal Spotify. I can easily play an audio file using Streaming Media plugin, but it seems that this plugin was made for video purposes, because it always brings the player to the front in fullscreen, so you can't navigate through the app while the music is playing, you also can't lock your screen or the playback is stopped.
Is there any way to stream music in the background? Like when I tap the song I want to play, it just starts playing without bringing in another screen? (like you can easily do in AndroidStudio with MediaPlayer). I've search it anywhere for the past week and I just can't find any solution.
I realized Background-Audio in my ionic2/3 Project with
cordova-plugin-media 3.0.1 "Media"
cordova-plugin-music-controls 2.1.4 "MusicControls"
and to workaround some issues on ios I need to add this plugin also
nl.kingsquare.cordova.background-audio 1.0.1 "background-audio"

Enabling background play of YouTube videos

My app had to reject it because it violates our device and network abuse policy .
They told "Modify your app to make sure it doesn’t access or use a service or API in a manner that violates its terms of service; for example, by enabling background play of YouTube videos."
How I enabling background play of YouTube videos?
This sounds similar to this issue:
Android App rejection from Google Play
So it looks like you must have a web view that allows playing youtube videos, and they will continue to play when the app is put into the background. That, apparently is against youtube's policy.
So, looks like you'll need to deal with this case inside your lifecycle's "stop" method, to pause or stop the youtube video when your app goes into the background.

Ionic Framework Lifecycle

Is there Ionic application lifecycle like Android. I am asking this because I am developing an video application and while my application went background video still plays like android service or I push hardware backbutton video still plays.
Ionic framwork lets you develop the beautiful, hybrid mobile apps using open source front-end SDK and HTML5.
you can refer lifecycle events from http://ionicframework.com/docs/api/directive/ionView/.
even you can handle one from given event to stop application from running when application goes into background.
You need to handle pause event to stop executing till application again resumed. again at the time of resume you can use resume event to again initialize.

Demo Glassware via screenshare

I have built a demo application that I want to demo to a room of people. How do I go about sharing my google glass screen with the audience? I saw that in Google I/O, engineers were using something to share their screen with the audience, how do I get that?
The MyGlass Android app has a feature called "screencast" - if, for example, you set up a Nexus 10 with MyGlass, you can then use the mini-HDMI out to project the screencast to a large audience (I'm not sure how you'd hook other Android devices up to a projects, but I know this Nexus 10 method works).
You can find the screencast function at the bottom of the main drop-down menu in the MyGlass home screen.
I would turn debug mode to "on" in my Glass settings and then use Android Screencast to display the view from Glass on my computer screen. From there I could use a projector or external monitor for demoing purposes.
There is also a cool jar that I found called droidAtScreen which uses ADB to render whats showing on the glass onto a GUI; no setup required, easy to use.

Resources