• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to access pc from an android app?

pnkapdia6

Lurker
I'm working on a project where in I need my android phone to control my pc just like remote desktop. I'm aware of various apps(2x Client , RD Client) and softwares(VNC) already available. But what I want is to build it from scratch. So what can be my approach? Can I use RTP or something else?
 
I don't know if it's possible to do it directly via USB cable, but if I were doing this, I would create two apps, one runs on Android, another one on PC, Android and PC both must be connected to the Internet. Both apps are connected to one server and Android app sends messages to PC app via TCP connection.
 
Hi ! Similar App's need use java.net.Socket - it is basic library in Java to connect devices by TCP (WiFi , 3G etc) . But I think there are short way. Try use open source soft like VNC Servers for Windows and Linux but Android client need to build it from scratch probably.
 
Hi,


how to query a OnClickItem open a one item...


public class MainActivity extends ActionBarActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
}
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {

// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.product_label) {
return true;
}
return super.onOptionsItemSelected(item);
}

/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
private ListView myListView;
private String[] strListView;

public PlaceholderFragment() {
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container,
false);
myListView=(ListView) rootView.findViewById(R.id.myListView);
strListView=getResources().getStringArray(R.array.my_data_list);
ArrayAdapter <String> objAdapter=new ArrayAdapter<String>(this.getActivity(),android.R.layout.simple_list_item_1,strListView);
myListView.setAdapter(objAdapter);
myListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {



private Context MainActivity;
public void OnItemClick(AdapterView parent,View view,int position,Long id){
Toast.makeText(this.MainActivity,"You Click" + strListView[position],5000);
}
@Override
public void onItemClick(AdapterView arg0, View arg1,
int arg2, long arg3) {
// TODO Auto-generated method stub

}
private Object show() {
// TODO Auto-generated method stub
return null;
}
});
return rootView;
}
}

}
 
Using tools like on premise R-HUB remote support servers, logmein, Teamviewer etc. you can easily access PC from Android mobielm phone and vice versa.
 
Back
Top Bottom