I've got this http_post xml sending in my android project:
try {
xml_input();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.e("Hiba!", "Xml_input fgv hivasa");
}
// TODO Auto-generated method stub
HttpPost httppost = new HttpPost("http://users.atw.hu/festivale/xml_post.php");
I need to wait until android enables wifi ( you can't just "setWifiEnabled(true)" and expect to be enabled instantly).
Why my input stream string dont go in new line when using \n in .txt???
I am triying to read and then post it into TextView but it shows \n insted of going to new line -.- Cloese enough
try {
reader = new InputStreamReader(getAssets().open("koce_podatki.txt"),"UTF-8");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
i converted String "Mon, 11 Feb 2013 08:00:00 CST" to date using the following code
java.util.Date d=null;
try {
d= new SimpleDateFormat("EEE, dd MMM yyyy hh:mm:ss z").parse("date");
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
How to add this date to calendar as a beginTime and also an endTime 30minutes difference
I have a cheerapp.mp3 in my /res/raw folder
so my code is
String filepath="/res/raw/cheerapp"; //or cheerapp.mp3
file = new File(filePath);
FileInputStream in = null;
try {
in = new FileInputStream( file );
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
The error I got file not found. why?
I've been sending packets to clients connected to the server fine, but trying to
send the same packet to the actual host itself keeps coming up with an error.
Here is the code that breaks
if(socket == null)
{
try
{
socket = new DatagramSocket( port );
}
catch (SocketException e)
{
I'm new to android programmation.
I'm writing an android app I use a background thread to pull a JSONArray from a web service. I then need to interact with that JSONArray inside the main activity.
I am making an app in which i want to stream live audio and play in my application and i am unable to play.My code is as follows:
play=(Button)findViewById(R.id.button1);
pause=(Button)findViewById(R.id.button2);
stop=(Button)findViewById(R.id.button3);
mp3=new MediaPlayer();
try {
mp3.setAudioStreamType(AudioManager.FLAG_PLAY_SOUND);
mp3.setDataSource