[FEATURE] Universal remote
#1
It would be awesome if some universal remote capabilities could be added. I have been following this guid here. The app on android needs to run the php script, fx poweron, so it will poweron my TV. I tried to do this myself by following the helloformstuff on android dev page. But i can't get it to run the php script without the browser opening on the phone. Maybe this is something that will implemented, but if not i would really appreciate it if someone could point me in a direction to make this happen without the browser.

Code:
package com.example.helloformstuff;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class HelloFormStuff extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        final Button button = (Button) findViewById(R.id.button);
        button.setOnClickListener(new OnClickListener() {
            public void onClick(View v){
                 startActivity(new Intent(Intent.ACTION_VIEW , Uri.parse("http://192.168.0.4/TV/POWERON.php")));
                }
            
        });
    }
    
}

Thanks
Reply
#2
Sending an Intent will ask android to handle the given URI, which is a web one, so it opens the browser.

What you want is to internally connect to the remote using an HTTP Client, not use an intent.

eg, using apache HTTP Client (I'd recommend this one)

http://developer.android.com/reference/o...lient.html

Look up Apache HTTP Client (version 4) for more docs, as the android ones are just the javadocs.
Reply
#3
Okay i tried to look into this... I don't know much about programming so it quickly became complicated. I found some code on another page but couldn't get it to work. I will have to look more into this when i get some summer holiday.
Reply

Logout Mark Read Team Forum Stats Members Help
[FEATURE] Universal remote0