yashsingh1/xdaforums huggingface dataset:
[Android Software Development] UndergroundWire:
I coded an application that plays a radio stream. The App is very simple just start and stop.

When I press start, the stream plays just fine. But when I call stop, nothing happens.

Here is the code (items in red have been changed to protect the identity of this app :D).:

package [COLOR="red"]com.xxxxxx.stream[/COLOR];

import java.io.IOException;
import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class [COLOR="red"]NameOfAppActivity[/COLOR] extends Activity {
private Button start;
private Button stop;

MediaPlayer mp = new MediaPlayer();

/** Called when the activity is first created. */
@Override

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
initControls();
}

private void initControls() {
start = (Button)findViewById(R.id.start);
start.setOnClickListener(new Button.OnClickListener() {public void onClick (View v){Start();}});
stop = (Button)findViewById(R.id.stop);
stop.setOnClickListener(new Button.OnClickListener() {public void onClick (View v){Stop();}});
}

private void Start() {
try {
mp.setDataSource("[COLOR="red"]http://xxxxx.xxxxxx.com/stream[/COLOR]");
} catch (IllegalArgumentException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IllegalStateException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
mp.prepare();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
mp.start();
setContentView(R.layout.main);
}

private void Stop(){
mp.release();
}
}

I have also tried

private void Stop(){
mp.stop();
}
}

and

private void Stop(){
mp.pause();
}
}

Nothing seems to work. I have to force close the app in order to stop it.

What am I doing wrong? Please help.
[Android Software Development] Gene Poole:
mp.release() should do it. Have you tried the debugger to make sure that Stop() is being hit? I don't see why it wouldn't, but that's always the first thing I check when things don't behave like I think they should.
[Android Software Development] UndergroundWire:
Thanks Gene Poole. I will try debugging it when I am home. It's extremely frustrating. I changed the code to:

private void Stop(){
if (mp != null){
mp.stop();
mp.release();
}
}

Thanks for your input.
[Android Software Development] UndergroundWire:
Thanks. I figured it out. However. If I hit release, it doesn't play the stream again. The app just FCs. For now I have it set to stop
[Android Software Development] netlon:
How did you figure it out?

I see the same behavior.

I/HTTPStream( 194): 1358 Bytes read, progress 64711/65536

Still keeps going, even when I call mediaplayer.stop();

One way that does stop it is to call reset(), but that also hangs for a bit.
[Android Software Development] UndergroundWire:
Here is the revised code. There is no release in there but I'll figure it out soon.

package com.xxxxxx.stream;

import java.io.IOException;

import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class NameOfAppActivity extends Activity {
private Button start;
private Button stop;

MediaPlayer mp = new MediaPlayer();

/** Called when the activity is first created. */
@Override

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
start = (Button)findViewById(R.id.start);
stop = (Button)findViewById(R.id.stop);
start.setOnClickListener(new Button.OnClickListener() {public void onClick (View v){Start();}});
stop.setOnClickListener(new Button.OnClickListener() {public void onClick (View v){Stop();}});
}

private void Start() {
try {
mp.setDataSource("http://xxxxx.xxxxxx.com/stream");
} catch (IllegalArgumentException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IllegalStateException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
mp.prepare();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
mp.start();
}

private void Stop(){
if (mp != null){
mp.stop();
}
}
[Android Software Development] UndergroundWire:
The code works fine for the most part. However if I am running the stream and exit the app and comeback to the app, I can not stop it. How do I restore the application's previous state.
[Vibrant Q&A, Help & Troubleshooting] TwoGunsGeronimo:
So my friend bought a vibrant last week, and already received the JI6 update. I bought it 2 weeks after release, and I still haven't received it. All I've done is root my phone and put the battery icon (where it's the circle and has the percentage in it). Do I have to reset my whole phone to factory settings? I want this update bad cause I travel a lot and use the map frequently, but keep "searching for gps" or "rerouting". Please help????
[XPERIA X10 General] Saweetarab:
Hi All

Not the most active poster on these boards, but I do pay a close eye to what's going on and get my regular updates from xperiax10.net

As the title suggests I'm moving on, as much as it pains me and no doubt many wont care and might flame me but hey I thought I would take the time to wish you all well. I'm not going because of the length of time its taken for the updates to come out or because of broken promises. I'm off because of the in call volume (or lack of).

Anyway, there was another reason for me writing this post, seeing as I wont have an x10 from tomorrow that leaves me with a single clear-coat screen protector which I'm not going to be able to use. I'm not interested in selling it, but if someone was willing to make a generous donation to ELF then please can you pm me and the first to do so, then send me proof of their donation can have the clear-coat (please don't go donating till I have pm'ed you back).

Anyway I wish you all the best, and I hope that SE pull their finger out for their next android phone, the X10 has so much potential locked away in it.

Peace out
[Captivate Q&A, Help & Troubleshooting] neo_31591:
hey i just got hold of my captivate....i was using an iphone earlier and itunes was a bliss....i cant seem to figure out how to use the samsung kies to automatically sync music,songs an videos??

i did it manually though by creating a music folder.....

also what format video does it play???

and at what resolution?

also if i have to do it manually,where do i create all the folders?i dont want a cluttered space....also id prefer if all the videos etc are all stored on the inner sd card
[Captivate Q&A, Help & Troubleshooting] catire:
Itunes bliss? really? ;) :p

Have you tried

http://www.doubletwist.com/

According to Wikipedia
[Captivate Q&A, Help & Troubleshooting] neo_31591:
hey thanks!!!ill try doubletwist

itunes a bliss is a debatable topic....lol...i personally find it very easy to use and helps me remain orgainsed!!
[Captivate Q&A, Help & Troubleshooting] catire:
If that doesnt work (I havent tried doubletwist) maybe one of these apps might work.

I dont have my captivate yet (never owned an android phone before either) so let me know if any of those work out. :D
[Captivate Q&A, Help & Troubleshooting] Pirateghost:
if you manually add your media to your device, you can arrange it however you want....beauty of android=its yours to do with what you want
[Captivate Q&A, Help & Troubleshooting] neo_31591:
lol!!

im using Handbrake to convert videos to captivate suitable

can anyone please mention the settings in the handbrake??
[Captivate Q&A, Help & Troubleshooting] fritzgerald:
By videos do you mean movies? If that's what you're doing then I use DVD Decrypter to rip them to my laptop then AutoGK to convert them to XviD. I just leave all settings default and set the size to 1CD (700MB). The movies play fine and it's not like it's taking up too much storage space.
[Captivate Q&A, Help & Troubleshooting] avgjoegeek:
I play .avi due to its file size.

Otherwise I don't miss itunes except for pod casts.

Now I can put what media I want on my sdcard and don't worry about it.

You get used to it.
[Captivate Q&A, Help & Troubleshooting] MikeyMike01:
Drag and drop is the perfect way to put anything on any device.

The fact that people want junk programs (especially one like iTunes, which loads a chunk of it's bloated self at startup and slows your computer down) is mind boggling.
[Captivate Q&A, Help & Troubleshooting] mcdewi:
Try isyncr. It doesn't require a program on your computer and will sync play-counts and ratings back and forth. I really missed iTunes myself and this helped with the transition.
[Captivate Q&A, Help & Troubleshooting] newter55:
Isyncr is by far the best especially if you add the wifi tool for a buck I think...never even have to plug phone into computer just walk into house and click on wifi app and auto syncs what you select

Edit....Of course that requires a wireless network

Sent from my froyo'd cog'd captivate
[Captivate Q&A, Help & Troubleshooting] Palmetto_X:
I used Handbrake set with high profile settings and they looked great.
[Captivate Q&A, Help & Troubleshooting] neo_31591:
thanks...ill check it out...i tried playing hd video (avi format)...it ran very nicely but no sound :(:(

hey can u please lemme know from where can u download .apk files for apps and games? ? ?i just learned how to do sideloading....
[Captivate Q&A, Help & Troubleshooting] Dungeon47:
Put me down as another iSyncr supporter. I like using iTunes to manage my music library, but not lock down my device.

In handbrake, I've had good success with using the default iPhone preset, but changing the horizontal resolution to match the source video (up to 800). A high quality 2hour movie runs about a gig that way. Medium quality is about 400mb.
[HD2 Android Q&A, Help & Troubleshooting and Genera] kiteboarderni:
Either it is not signed with a trusted certificate.

Earlier today my phone just rebooted, and now every time i try to run clrcd, or haret this happens! Totally out of the blue and ive no idea how it happend!

Any solutions would be appreciated!
[HD2 Android Q&A, Help & Troubleshooting and Genera] Don001:
Copy your data image and then replace the files in the Android folder again and then copy your data image into the folder, let me know what happens
[HD2 Android Q&A, Help & Troubleshooting and Genera] kiteboarderni:
same thing man, even when the card is wiped.

Doesnt seem to run any unsigned programs. would there be any reason for this?
[HD2 Android Q&A, Help & Troubleshooting and Genera] kiteboarderni:
Just soft reseted, and i get exactly the same problem.

Anyhelp would be appreciated
[Nexus One General] diversificationied:
Does anyone find it ironic that nearly all HTC phones that are launching as part of the W7 campaign are essentially N1's loaded with w7.

All first gen snapdragons, they all share the N1 styling/materials.

Hopefully we can dual boot w7 due to the similarities. =D
[Nexus One General] Lamar720:
I don't think they are but, I need to see a side by side. I thought most of the new w7 phones had better specs then the n1. But, of we have the best community of any phone out. That is why Google needs to make another dev phone it don't need to be called nexus two......
[Nexus One General] diversificationied:
Check out engadget's front page, mozart,shobert,surround, trophy
[Nexus One General] jasrups:
Not terribly impressed with the W7 OS. From a UI standpoint, I could see the home screen getting very cluttered and I'm not sure if they have any sort of folder management system either to alleviate that. The multitouch zoom and kinetic scrolling in IE looked fluid but not having text reflow hurts. The Bing app was nice, as was the XBOX Live integration which is cool if you're into that but everything else was very meh. Didn't look awful like previous versions of WinMo but nothing that blew me away either. Still well behind Android and iOS even.
[Nexus One General] Paul22000:
WP7 seems very solid in terms of how it is being handled. I love this quote:

I wish Google had the balls to do that.
[Nexus One General] ap3604:
Kind of reminds me of my favorite writer online: MG Seigler of TechCrunch

He really is the voice of the people and calls out Google for folding to the carrier demands like a guy with no confidence that gets walked all over by the hot girl (the carriers) that dont care about anyone else but herself

Here is a great article by MG Seigler on Andy Rubin making excuses for Google folding to whatever the carriers demand so that they can stay in bed with the enemy carriers: http://techcrunch.com/2010/10/08/android-carriers/

Google really needs to grow a pair and take control of Android. A carrier holding out an OS update just so they can force up to purchase a new phone might be the norm but that doesn't mean its right or should be tolerated by Google :mad:
[Nexus One General] diversificationied:
Google, by definition, can't control android, do you poeple not understand that?
[Nexus One General] Wisefire:
Damn straight.
[Nexus One General] ap3604:
That's weird I wonder why I even got heated in my post above :confused:

I mean hell... thats the whole reason why I got the Nexus One! to not have to deal with carrier games anymore ;)
[Nexus One General] krabman:
You meant to say that they cant control android but wield a mighty big stick with gapps didnt you? I tried cm without gapps, pretty much cuts the nuts right off the little android leaving it ineffectual.

in-ef-fec-tu-al adjective 1 Weak. 2 Without satisfactory or decisive effect. 3 Powerless, impotent. 4 Insufficent to produce the desired result.
[Nexus One General] mynameisjon:
MS does something right for once in the smartphone arena. Can't we just give credit when it's due?

Text reflow? As far as I know even in CM I have to double tap the browser page to get it to reflow.

The UI looks sweet as hell and not having to worry about carrier tied updates?

Priceless.
[Nexus One General] vegetaleb:
I really didn't like the W7 UI, no place for wallpapers and that it's a very negative thing for me
[Nexus One General] MaximReapage:
It had a very nice style IMO. I doubt I'll move from my N1, but it's definitely gonna be an interesting game here on out.
[Nexus One General] khaytsus:
So do you think you can just build AOSP and dump the result on any phone? No, it has to be tailored per-phone.. What changes there are between phones I wouldn't know, not a rom cook, but I suspect the complexity/time needed ranges from trivial to impossible (HW limitations).

So therefore, Google is not going to build, test, and deploy a build for every Android phone ever made. The carriers have NO INCENTIVE to support older phones.. They have gotten better about this, but they still have no reason to do it honestly, it's not like other industries where hardware sales lose money (printers, game systems, many others) and therefore they need to stretch the users experience with the hardware to the max. Phone sales net the carriers extended contracts and money.
[Nexus One General] Paul22000:
Actually they can, very easily:

Carrier/Manufacturer: Hey Google, we're going to release a phone with Android 1.5, replace your search with Bing, add some crap-ware, and remove a bunch of useful Android features!

Google: Oh really? Too bad your Android phone won't have Gmail, Google Maps, Google Talk, YouTube, Google Syncing, OR the Android Market!

Carrier/Manufacturer: Hmm...​
[Nexus One General] diversificationied:
Verizon doesn't seem to care. This does work though it's how android took off. However, not having gapps is more detremental to Google than carriers. At this point in the game android can survive without native Google applications.
[Nexus One General] mynameisjon:
So basically you're justifying carriers holding off hardware updates so that people can dump their 6 month old phone for a new one just to get from 2.1 to 2.2?

That's BS and you know it.

Android gets a new version every other month, and if they do this and leave older users in the dark with carriers blocking updates, Android is NEVER going to be real competition to iOS.

Hardware is just another BS excuse. 2.2 runs fine on even the HTC Dream.
[Nexus One General] crachel:
Android sold more units in Q2 2010 than iOS, so surely its already real competition?
[Nexus One General] jimbobalu:
Is just me or is one of the biggest faults with android the various phone form factors that make it impossible to standardize any accessories? Don't get me wrong, I wouldn't want to be locked into a single phone running android but it seems the phone manufacturers could maybe design their phones so they have common ports for accessories. I guess we are lucky we at least got a desktop and car dock. Even cars are coming with iphone, ipad docks, you'll never see an android dock.
[Nexus One General] EErez:
Google, from a business perspective, doesn't need to control android.

its not its number one priority. yes it could try to twist the carrier's arms, and yes most would fold, but even if only 1 of the big 4 refuses to fold and stops carrying android devices google losses.

google doesnt make money off of android. it makes money off of ads. it just wants you to watch the ads through its portals. you might say they lose that when carriers choose bing over google, but really most of the ads (in apps, around the web) are controlled by google because google owns the online ad market. in fact, they will make money off of the spread of windows 7 phones as well. they entered the mobile business just to make sure neither apple nor microsoft could cut them out of the mobile internet user base and therefore limit the number of users viewing their ads.

btw we are in the nexus one section of xda, which by definition means you cant complain about waiting for updates and carrier and manufacturer crippling. (ha! see what i did there?)
[Nexus One General] ATnTdude:
Umm...you really need to look up the definition of "irony." While it might be an interesting coincidence, there is nothing ironic about two different phones using similar chipsets designed by Qualcomm, but just so happen to have two different operating systems. QCOM designed SD to sell them in phones. They're selling them in phones.

Now, developing Android as a platform to generate web searches and ad revenue, only to have your search system ripped out and replaced with a competitor, THAT is ironic. GOOG built object A, for intent X, but y happened instead which actually hurts X.
[Nexus One General] :
All of HTC devices for the w7 launch (except the hd7) all share the same design principles of the N1, From the speaker grill to the textured materials.

The irony being that the N1's styling end up going to W7 devices. (I didn't think I'd have to stress I was talking about the styling since you know...you could just look at them).
[Nexus One General] bedwa:
What I see is that it boils down to the subsidy model. As long as we allow carriers to subsidize phones we allow manufacturers to overcharge on the phone and we have no way to get either the manufacturers or the carriers to give us anything. Thus the reason we all right N1s right?
[Nexus One General] Ebonwumon:
Just like reason on your wedding day.

-Sent from my Nexus One Superphone.
[EVO 4G General] Sporkman:
FAIL ! major
[EVO 4G General] Rydah:
Double fail!

Sent From My HTC Evo 4G Using Tapa Talk Pro!
[EVO 4G General] casual864:
Epic fail!!
[EVO 4G General] timtlm:
You have a source link?
[EVO 4G General] neodorian:
First offerings are typically missing things found on more robust devices. Think of the original iPhone--no native apps, MMS, GPS, copy/paste, multitasking, camera, 3G, etc. or the G1 or whatever.

Both iOS and Android started out on devices that were missing a lot of common features but now they are top of the line. I'm more interested in how WP7 looks in a year or two.
[EVO 4G General] nhutpham:
I think times have changed. WP7 has to be fully featured now. Smartphones are here, they are mainstream, and they are big business.

Turns out this information might not be correct just yet, here's what I found:

Here's what one can read on Microsoft's Windows Phone 7 portal:

“Some Windows Phones have a Secure Digital (SD) card that's used to expand the amount of storage space on the phone. If your phone has one, it's in an SD card slot underneath the battery cover on the back of your phone.

Windows Phone uses a special high–performance SD card that works differently than SD cards in other devices. When your phone is built and first set up, its internal storage and SD card are combined and recognized as one storage system.

Warning

You should not remove the SD card in your phone or replace it with a new one because your Windows Phone won't work properly. Existing data on the phone may be lost, and that SD card can't be used in other devices or Windows Phones.”

It kind of sounds like they just want to keep people from jailbreaking/flashing/rooting their phones, but maybe it's what they say.
[EVO 4G General] Sporkman:
http://www.neowin.net/news/microsoft-shows-off-10-new-windows-phone-7-devices

i take that back so far only 1 phone had a sdcard slot its the Focus all others are packing 16gigs of internal space
[EVO 4G General] Award Tour:
Windows Phone 7 has both good and bad, but to be honest, I like it a whole lot better in it's first release than I did with Android when it was first released.

One thing I like a lot, which I know a lot will disagree with, is (some of) the hardware standards. All WP7 phones, as far as I can tell, run the same old generation Snapdragon in the EVO (and even further back to 2009, the HD2). Yet the games and UI look great and run smooth. Having a standard level of specs means that it is easier to build a OS that will run as intended on all devices. With Android it's hit or miss; get a entry level Android phone and things will draaaaggg, get a high end phone without the latest and greatest CPU/GPU (EVO) and things will still not be 100% smooth. Google just can't optimize the experience for all these devices like Microsoft can -- and don't forget as a licensed OS, dev support comes attached.

The SD card thing is CERTAINLY LAME, I mean, what does that achieve? But the benefits to me are clear: WP7 will run smooth across the board; and with similar hardware and Microsoft support, updates will probably come A WHOLE LOT FASTER than what we get on Android.

I personally want to give WP7 a try, it's still missing a couple of important features (multi-tasking for third party media being the key thing). But the Office + Zune + Xbox Live integration looks better than anything comparable on Android, and as a designer who like smart minimalism, the Metro UI is perfect.

...and did you see the Touch Pro 7 coming to Sprint? That's the phone I was waiting for.
[EVO 4G General] uniquenameevo:
That would be impressive if windows hadn't been on cell phones for much longer than android.
[EVO 4G General] Award Tour:
Hmm.. Perhaps. Windows Mobile did almost everything Android does, only in a less intuitive/attractive way. Windows Phone 7 is an entirely different beast, and although the core is similar/upgraded, the UI/UX is entirely new. But still, there's no doubt that I'm interested.

Look at the TP7 for Sprint:

SEXY. Keyboard to die for IMO.
[EVO 4G General] prettyboyrob2007:
no 4g or front facing camera. im good
[EVO 4G General] uniquenameevo:
I'm not denying that it looks promising. I just was commenting that it's not the first entry into the mobile market. There has been a lot of trial and error to get there, just like every OS.