Im a new developer with 2-3 months of experience in android app development
I wanted to ask about is there a way to pop up a notification on a specific time or do anything!. I want to play a audio file on a specific time without clicking any button in the app or doing anything. For example : Muslim Pro in that app the prayer audio file is played on a specific time. I want to implement that functionality
Can you please explain to me how to do it?
Related
First time posting.
I want to make an alarm app that launches a radio app at the set alarm time.
The app works fine when the phone is awake, the radio app launches and the radio plays at the time specified by the alarm, my issue is when the phone is locked/asleep, the radio app I want to launch will launch but not attempt to connect to the radio stream until I unlock the phone. When I unlock the phone the app is open and starts to buffer then works.
How do I get the app to connect to the radio stream while the phone is asleep?
I have tried WakeLocks (Partial WakeLocks) thinking that keeping the CPU alive would allow the app to connect to its radio stream but this did not work.
Would appreciate any input here.
EDIT: I have downloaded an app that does what i want and it seems the radio plays within the notification.
Would this be the correct direction to investigate?
Well, I figured it out after eventually.
using media player and connecting to the correct steam sorted it for me.
For anyone struggling:
Main activity you want to create all the actions for the button clicks, build an Intent and get the time from the time picker.
Alarm receiver to handle the pending Intent
Radio service class to play radio stream using Media player.
It actually was very simple in the end.
one of the things that was holding me up was the incorrect use of the stream source I was using:
I was trying: http://www.lbc.co.uk/london/radio/player/
I needed: http://www.lbc.co.uk/london/radio/player/
I obtain the correct streaming link from FAQs on the radio website.
I will post a finished sample code once I have done cleaning the app.
Basically I'm developing a social networking app and wanted to know, how I could give possible notifications to the users who have downloaded my app to open the app and use it. It could be on some time period too. But I want to know even when my app isn't running in the background, then how can I give notification to the user to open it and use it?
For reminding you can use alarm manger.
while exiting app sets alarm manager after 3 days.
If user opens app within 3 days then cancel alarm and while exiting app again set alarm manager
whenever the user opens the app store the devices current date in your machine using SharedPreferences and keep a service running in the background which will check the systems current date and the date you have stored in your SharedPreferences and according to your logic when you think it is too much time give the notification
Links
SharedPreferences &
service
I am developing a musical piano app for android, in this app i want to record sound which user play by clicking piano buttons. I am using soundpool to play piano sounds. now for recording android gave us two api's MediaRecorder and AudioRecorder. but for both we have to set MediaRecorder.AudioSource. i didn't want to record sounds from mic because user sound can be included and more important sound quality decrease in recording. then i try to read bytes of that resource file which is played on clicking piano app. and when user click again and again then bytes will be together in global byte array. but when i play global byte array then this play only one resource file and one time only.
More important thing is i am new to android development. kindly guide me.
Although i did not find answer of my question, but now i am using technique for recording aspects which i want to share with all of you. Above function which i try to use is totally wrong option when you are trying to save music created by your app at run time. now for my first version i just saving the clicks of piano buttons along with system time in an array. now when i play that clicks it will play same sound as user try to record. i save these notes in database for further reuse by users.although this is not solution because these notes will be played in our app only, but this is good feature which we can add in our app. when i solve the correct solution, i will share with you guys
I was wondering what the best way to do this is. What I'm hoping to do is have a user push a button and automatically take a 10 second video, then save it to the SD card. I've seen how to do it through creating a new Intent, but the user then has to do the extra step of pushing record after selecting that they want to go to video. My goal is for them to push one button--one in my app that says "record", have it start recording for 10 seconds, then stop and save. In addition, I'd like to have some code executing in the background without being interrupted during said recording. What is the best way to do this?
Opening the camera with an Intent is simply opening the system camera app to take a picture/video. For more advanced usage, you can control the camera directly. Full details are in Controlling the Camera (from Android Developers).
You should make a service for that.
I'm trying to learn more about Android development, and I think I have hit a tough patch. Basically, I want to be able to send a "fake" key-press to the entire android system. For example, lets say I have my music player going and I want to pause the music. I should be able to send:
KeyEvent eventPause = new KeyEvent(KeyEvent.KEYCODE_MEDIA_PAUSE, KeyEvent.KEYCODE_BACK);
System wide so it will stop/pause what ever media event is playing. The problem is, I keep finding things online about an instrumentation class, and some other weird classes that I either will have trouble compiling or has been taken out of the android API.
Does anyone know a way I can do this? I have a rooted phone, so a solution that requires root is perfectly fine for me.
Thanks!