Sound manager - Libgdx Android - libgdx

Some android devices has differente volume controls. One for calls, one for messages and one for applications.
In this devices, My game affects all 3 volumes controls.
I’m using a very basic code:
Music music;
music = bb.assets.get("sounds/breaking_stuff.mp3", Music.class);
music.play();
music.setLooping(true);
music.setVolume(0.5f);
I have to do some special trative for these devices?
I would like these cases, only the volume of the application was changed.
How to do that?

Related

Do tvOS transmissions stay active since there is no drain on battery?

Two part question:
First, does the Apple TV run app activities in the background while it is asleep? I would assume this would be the case since the Apple TV isn't relying on battery.
Second, if this is not the case, how would I override this keep an app running and writing to my database?
I am building an app that connects to Bluetooth LE, then writes to a database after connecting. I would like the Apple TV to be the "hub" for my device. So as long as the Apple TV can stay awake, unlike iOS, I should be fine. I could be looking at this the wrong way. Please feel free to correct me.
tvOS runs the same application state mechanism that iOS does. Meaning it has the same old:
not running > suspended > background > inactive > active
This also means that it will do basic background processing based on very specific background tasks you specify, just like iOS. Though, tvOS does not have a background data-refresh function, which I'd imagine you'd want to use for the scenario you described.
Check out this Apple doc for more modes. https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW22
To specifically, answer the question: There may be a way to do some background data work, but it would be very limited; And you can prevent sleep programmatically by doing:
[UIApplication sharedApplication].idleTimerDisabled = YES;
This apple doc will give you all you need to accomplish this.
https://developer.apple.com/documentation/uikit/uiapplication

Can I share a file to other plateform (iOS or Android) via Bluetooth on WP8?

My WP8 app has some audio or videos, I'd like to share them with other plateform devices, such as iPhone or android devices. The first thing that comes to mind is Bluetooth. Can I realize this feature in my app? And how to do it? Thank you!
Sure you can do that, its the same like all file sharing apps do (whatsapp for Example) but your are about to do this using bluetooth connection, you just need to build a connection and transfer the file to the target device which should be able to open the file according to its format and the installed apps on the device.
I've worked with iOS Bluetooth extensively and the different ways you can share data over Bluetooth is by:
Using one of the Bluetooth profiles already supported by iOS: http://support.apple.com/kb/ht3647
Bluetooth LE (Core Bluetooth). I haven't used this, but the bandwidth and data structure of data being transmitted is limited, so it may not suit your purpose of sending audio and video.
Game Kit. This is for iPhone-to-iPhone data transmission though.
External Accessory Framework. This framework allows you to transmit raw data, but is only available to BT-enabled devices with special Apple authentication hardware (you have to join the MFi program and go all these hoops to get your device qualified). This doesn't work for you too, since you'd want to send data from WP8 or Android, which are definitely not MFi qualified.
So, bottom line, you CAN NOT send raw audio or video data from WP8 and Android to your iPhone unless you jailbreak the iPhone and put a new stack. iOS's BT stack is really limiting in that way, as I've learned the hard way.
On the bright side, you can definitely send raw data between Android and WP8 over Bluetooth. You have to create an RFCOMM socket on both ends (one sending; one listening). The Bluetooth profile used for this sort of data transfer is called a Serial Port Profile.

Output sound to headphones and speakers

Im wondering if it is possible to output sound to both headphones and built in speakers at the same time. Iv searched but all i can find is references to possible attemps using android. but my application will be web based, using flash and AS3. Can anyone confirm if this is possible or not?
essentially im trying to make a set of DJ decks, and thus need to be able to listen to 2 sounds separately but at the same time (to beatmatch)
Many Thanks
Andy
No, not without a very specific setup. Flash will only output one, globally mixed audio stream from the application. You cannot separate your sounds to be routed to separate outputs.
However, if you're not looking for a general setup but rather a one-off thing where you are able to control the machine it is supposed to be running on - there could be a way. If you are writing an Adobe AIR app, you could write two separate apps:
App A controls the UI and all the sound
App B just receives a sound stream from the first app and plays it
App A then routes the "headphone track" to App B and plays the "main track" as normal.
You could then (maybe) use an application such as Soundflower to route the sound from App A and App B to separate outputs (where one could be the headphones and the other would go to some speakers.)
This all is very dependent on your sound card. You'll most likely need an external sound card to handle the two separate audio streams.

Local network p2p connection with Windows Store Apps

I am building a small cards game for Windows Store using HTML/JS as my programming languages. One of the features that I would like to add is multiplayer capability. My game it's based on a 1 versus 1 player (unlike Hearts where you need 4 players), so an ad-hoc peer-to-peer connection is enough. Also, keep in mind that I am only considering local network multiplayer, without internet support (meaning that "privateNetworkClientServer" capability is required on that app manifest).
So I am imagining, when a player want to start a multiplayer game, the app will periodically broadcast a message to find any candidates. Meanwhile he will also have to listen for those same messages (in case of another player is broadcasting them also). When they find which other we transmit the game state back and forward to perform the required games changes.
My question is, does WinRT provide any functionality out of the box to do something like this? If no, do you have any suggestion for my problem?
Thanks
Look at the documentation for the PeerFinder class. Proximity can use either NFC or by browsing on the same subnet. Note, in the case of WiFi, not all WiFI cards support the browsing model, so some older PCs may not be able to use this solution.
The proximity sample application on msdn should help you with this.

Developing a video player app

I want to build a video player on android platform which is actually for E-learning purpose and thus here protection and piracy of videos is major concern. The video player will be connected to a server which has all the videos and only on subscribing to the video, the user can download the video.
But now i need to protect the videos from being shared also. So what I thought is to make a hidden password protected folder from my app which would contain only the downloaded videos, so that even if someone accesses the folder cant get the videos in them, and thus piracy will reduce.Here the password is not available to the user also because the file should only be played on my media player which has the decrypt code. No other player can play that file.
My major doubt is do you think this idea is feasible?? Actually I am new to Android development so if you could guide me as to how could this be done?? I plan to use either the media player class or the VideoView class for the same? What do you suggest would be better for this application?
Is is possible to stop the installation of any app without internet connection, even if the user has the .apk file??
Instead of bundling the video with your app - why not host all the media on a remote server? The users can then download/stream from there after authentication.