- Best Ways to Control Android from Android
- Three Useful Applications Used to Control Android from Android
- TeamViewer – Remotely Control Android from Android for Free
- RemoDroid – Control Android from Android Remotely with Rooting Devices
- AirMirror – Control Android from Android Remotely with or without Rooting Devices
- 7 ways to control your Android from a PC
- Ways to control your Android from a PC:
- Pushbullet
- AirDroid
- Vysor
- Scrcpy
- DeskDock
- Samsung Flow
- TeamViewer QuickSupport
- Enhancing your Android app with Bluetooth features
- Why should I care about Bluetooth?
- Bluetooth Permissions
- Does the device even support Bluetooth?
- Enabling Bluetooth
- Finding devices to connect to
- Retrieving the list of paired devices
- Discovering new devices
- Entering discoverable mode
- Issuing a discovery request
- Making the connection
- Client
- Server
- Transferring data
- Wrapping Up
Best Ways to Control Android from Android
Wouldn’t it be amazing to mirror your device from another and control Android from Android? Say, for example, your colleague needs help on using a certain application that you know. Or, you’re a tech support who wants to configure the mobile device of a client to fix the problem at hand. In these instances, having access to Android is necessary, as it will allow you to provide a proper and hassle-free demonstration. Read to find out some reliable applications that you can download on your mobile phone.
Three Useful Applications Used to Control Android from Android
TeamViewer – Remotely Control Android from Android for Free
The first application you may use is TeamViewer. This is widely known for its ability to control the computer remotely. But aside from that, it has a mobile version that is equally useful as a desktop. The app’s latest update allows you to mirror Android to Android. Moreover, it enables one to access the mirrored phone and use the keyboard from the receiver. Hence, you can view your friends’ smartphone even when they are far away. Just remember that your phones should be connected to a working Wi-Fi network. Once you’re done, follow the instructions below to know how to control Android from Android.
- Download TeamViewer QuickSupport on the streaming device and install the free Add-On when prompted.
- Consequently, download TeamViewer from the other device.
- Upon opening QuickSupport, you will see an ID. Simply input it to the receiving phone and tap “Remote Control”.
- Click “Allow” to accept the remote control.
RemoDroid – Control Android from Android Remotely with Rooting Devices
RemoDroid is another application capable of controlling Android devices from an Android phone and Windows/Mac computer. It is originally designed for Android TV’s, but the app works on a wide range of Android phones and tablets. Thus, this can be used if you need to share your phone screen remotely. However, it’s still in the beta stage so there are bugs within the app that can affect its performance. In addition, RemoDroid is not compatible with all units and it requires rooting of your receiving device. Nevertheless, it works pretty well on managing your phone from another device. Check out the guide below to access Android from Android.
- Install RemoDroid on your Android devices.
- Once the installation is done, run the app on both phones and tap “Allow Remote Control” on one phone to make it detectable.
- After that, click the “Connect to partner” button on the rooted device. The app will then show you a list of available devices. Select the name of the first Android and hit “Connect”.
- Press “Allow” or “Connect” to display your screen successfully.
AirMirror – Control Android from Android Remotely with or without Rooting Devices
Last on the list that will allow you to control Android from another device is AirMirror. This application is from the developer of AirDroid—a popular phone manager for the desktop. With this, you can monitor your phone remotely and help your co-workers resolve Android issues. Like RemoDroid, rooting of devices is needed but you can still use your phone without going through this process. You just have to enable Non-Root permission which is a little technical. Given that you have a rooted device, let’s proceed with the steps on how to remote access Android to Android.
- Download AirMirror on one device while installing AirDroid on the other.
- Create an account or sign in to the applications (AirMirror and AirDroid) if you are an existing user.
- Wait for the connection to take place. Once done, you’ll be able to control your Android phone.
Additional guide for unrooted devices:
- Download AirDroid on your computer and sign into your account.
- From the main interface, click on the third icon from the side panel or the AirMirror logo and hit “Non-root”.
- Follow the instructions on your screen to enable controlling of Android without rooting.
Conclusion
Generally, there are many mirroring applications from the Play Store that allow you to cast your Android screen to another Android device but only a few of them offers a control mode feature. The three applications above are among those who can provide a secondary display as well as allow users to control Android from Android. To sum it up, TeamViewer does not demand a tedious and additional process to connect between phones as compared to RemoDroid, which needs a rooted device. Meanwhile, AirMirror provides two options to establish connections. One is for the rooted device and the other is for an unrooted one.
Источник
7 ways to control your Android from a PC
You might find that you want to control your Android phone right from your laptop for one reason or another. Maybe you have dreams of playing mobile games on the big screen, or perhaps you need to answer messages. Either way, the process is straightforward with a little bit of software help. There are a few mobile apps you can try as well as a few web apps to consider. Here are the best ways to control Android from a PC.
Ways to control your Android from a PC:
Pushbullet
Price: Free or $4.99 per month
Pushbullet doesn’t go so far as to grant you complete control over your Android phone from a PC. However, it does put all of your notifications right at your fingertips. You can send and receive files and messages with optional encryption and use universal copy and paste to manage messages faster. Pushbullet even lets you control multiple devices at the same time.
Although the basic platform is free, you’re limited to 100 messages per month if you don’t pay. Pushbullet Pro will run you $4.99 per month or $39.99 if you pay annually.
AirDroid
Price: Free or $2.50 per month
AirDroid is one of the more powerful ways to control Android from a PC, and it combines several features from the other apps on this list. You can manage your messages and notifications or go in-depth and mirror your screen and mouse. Not all of the mirroring features are as smooth as some other options, but they’ll do in a pinch.
AirDroid has another advantage over platforms like Pushbullet, too — it costs as little as $2.50 per month. You can also download companion apps to add even more functionality.
Vysor
Price: Free or $10 per year / $40 lifetime
Vysor is a bit simpler than AirDroid in that it places most of its emphasis on screen mirroring. It’s a great option if you’re a developer looking to test your app while developing it or if you want to tinker with the perfect home screen setup. If Vysor is your chosen way to control your Android from PC, you can choose between speed and performance depending on your needs.
As usual, there’s a paid and a free version, and you’ll need to pony up if you want all of the features. A paid Vysor subscription offers things like wireless connectivity and full-screen mirroring.
Scrcpy
Price: Free
If you want to control your Android from a PC entirely, Scrcpy goes even further than Vysor. It’s an open-source program, though, so you’ll have to do a bit more work to reach the promised land. You can use a USB connection or Wi-Fi to pair your phone, and Scrcpy allows for screen mirroring and notification management. However, if you want to tap into Scrcpy on Linux, you’ll have to build out your interface from scratch.
This is one of the few free programs on the list, and Windows or macOS users can download ready-made options straight from GitHub.
DeskDock
Price: Free or $5.49
Instead of allowing you to mirror your screen, DeskDock keeps things remarkably simple. The app will enable you to bring your computer mouse right onto your Android device with total control. It’s a developer’s dream, especially in the testing phase. You can quickly fire up your app and use your computer’s mouse to test different functions rapidly.
The base version with mouse sharing is free, though you can pay a monthly fee and share a bit more. Bonus features include keyboard and clipboard sharing for easier access.
Samsung Flow
Price: Free
If you want to control your Android phone from a PC, specifically a Samsung phone, Flow is your best bet. It allows you to bring any of your Samsung products into the same fold and seamlessly share notifications and settings. If you want to bring your texts over to your Galaxy Tab, you can do so in seconds. The same goes for notifications on your laptop or Galaxy Chromebook. Don’t worry; you don’t need to have a Samsung laptop to make Flow work.
If you have a newer device, you can also use Samsung DeX for a wired mirroring experience.
TeamViewer QuickSupport
Price: Full TeamViewer support from $50.90 per month
TeamViewer’s QuickSupport app is a small part of the much larger ecosystem, and it’s a must-have for just about any business. It allows you to provide tech support right from your laptop to an Android device, so long as you have the app and the desktop software downloaded. Like many options on the list, QuickSupport allows for file and message control remotely across almost all Android devices.
Of course, TeamViewer is slightly different than the other options in that it’s a full-service platform. It’ll cost a pretty penny, but you’re getting far more power for your money.
Источник
Enhancing your Android app with Bluetooth features
Bluetooth provides users with a quick and easy way of exchanging data between a wide range of different devices, but there’s a couple of reasons why Bluetooth is particularly popular among mobile users:
- It’s wireless – because no-one wants to carry cables around with them on the off-chance that they might need to exchange data with another device at some point during the day.
- It’s not dependent on other networks. You don’t have to hunt down an open Wi-Fi network every time you want to use Bluetooth.
- Bluetooth doesn’t use your mobile network, so don’t worry about burning through your monthly data allowance.
In this article I’m going to show you how to give your Android apps the ability to discover and connect with other Bluetooth-enabled devices. What your app does once it makes this connection will vary from app-to-app, but I’ll also be outlining the steps you’ll typically take to send data from one device to another – you can then tweak this formula to suit what you specifically want to achieve with your app’s Bluetooth connection.
Note that this article uses Classic Bluetooth, which will be suitable for the majority of use cases. However, if you’re designing an application that targets devices with stricter power requirements, such as Google Beacons, heart rate monitors or fitness devices, then you may want to look into Bluetooth Low Energy (BLE) instead.
Why should I care about Bluetooth?
Adding Bluetooth functionality to your app can improve the user experience in a number of ways.
The most obvious is giving your users an easy way of sharing your app’s content, for example if you’ve developed a calendar app then your users might appreciate being able to share their schedules with friends, family and colleagues.
Sometimes users may already have a way of sharing your app’s content, for example by using their device’s stock apps, but this doesn’t automatically mean they won’t appreciate being able to access the same functionality from inside your app. Imagine you’ve created a camera app – users can already share photos via the stock Gallery or Photos apps, but having to launch a separate app every time they want to share a photo is going to get really frustrating, really fast. In this scenario, integrating Bluetooth functionality into your app has the potential to greatly improve the user experience.
Alternatively, you could set your sights on developing an app that’ll improve the user’s Bluetooth experience as a whole (if you need some inspiration, then take a look at some of the Bluetooth applications already available on Google Play).
While exchanging content may be the first thing that springs to mind when you think about Bluetooth, you can use Bluetooth for much more than simply moving files between devices. For example, you could design an app that uses Bluetooth to control other devices, such as an automation app that can execute tasks on the various Bluetooth-enabled devices around the user’s home or office. This area is particularly exciting since we’re seeing a greater variety of Bluetooth-enabled devices than ever before, which means more opportunities to design new and unique experiences for your users.
Basically, there’s lots of ways that you can use Bluetooth to enhance your applications – and Bluetooth functionality doesn’t always have to be limited to sending files from one device to another.
Bluetooth Permissions
If your app is going to do anything Bluetooth-related, then it’ll need to request the BLUETOOTH permission, which allows your app to perform essential tasks such as enabling Bluetooth on the user’s device, connecting to other devices, and transferring data.
Your app may also need to request the BLUETOOTH_ADMIN permission. Specifically, you’ll need to request this permission before your app can perform any of the following tasks:
- Initiating device discovery. We’ll be looking at issuing discovery requests later in this article, but essentially this is where a device scans the local area for other Bluetooth-enabled devices to connect to.
- Performing device pairing.
- Changing the device’s Bluetooth settings.
You declare one, or both of these permissions by adding them to your app’s Manifest:
Does the device even support Bluetooth?
Another important step, is verifying that the current device actually supports Bluetooth. While the majority of Android devices do feature Bluetooth hardware and software, the Android platform runs on such a wide range of devices that you should never assume that your app will have access to certain functionality – even when it’s something as common as Bluetooth.
To check whether a device supports Bluetooth, your app should attempt to acquire the device’s BluetoothAdapter, using the BluetoothAdapter class and the static getDefaultAdapter method.
If getDefaultAdapter returns null then the device doesn’t support Bluetooth, and you should notify the user that they’ll be unable to use your app’s Bluetooth features as a result.
If Bluetooth isn’t available on the current device, then in the interests of providing a good user experience you should disable all of your app’s features that rely on Bluetooth. The last thing you want is the user trying to access these features, discover they’re not working and subsequently leave a negative review claiming that your application is broken.
Enabling Bluetooth
Once you’ve verified that the device does actually support Bluetooth, you’ll need to check whether Bluetooth is enabled, by calling the isEnabled method.
This method will either return true (if it’s enabled) or false (if it’s disabled). If isEnabled returns false, then you’ll need to issue a dialogue requesting that the user switches their device’s Bluetooth on.
The system will then call your Activity’s onActivityResult method and pass it the user’s response. The onActivityResult method takes the following parameters:
- The request code you passed to startActivityForResult. This can be anything you want; in the following example I’m going to use ENABLE_BT_REQUEST_CODE.
- The resultCode. If Bluetooth has been successfully enabled, then the resultCode will be RESULT_OK. If Bluetooth wasn’t enabled (either due to an error or because the user chose not to enable it) then the resultCode will be RESULT_CANCELED.
- An Intent that carries the result data.
In the following code, we’re checking whether Bluetooth is enabled and then issuing a dialogue if it isn’t:
Now let’s take a look at our onActivityResult() implementation:
Finding devices to connect to
If your app is going to exchange data over Bluetooth, then it needs to find remote devices to exchange data with. This means either:
- Querying the list of paired devices. If the local device has a list of known devices, then your app can retrieve this information and display it to the user. The user can then decide which device (if any) they want to connect to.
- Scanning the area for nearby Bluetooth-enabled devices, by initiating device discovery. If another device is in the local area and that device is currently in a discoverable state, then this device will respond to your discovery request.
- Making the local device discoverable. When the local device is discoverable, any device that’s scanning the area will be able to “see” your device, and potentially connect to it.
In the following section, we’re going to look at how each of these methods works in more detail, and how you can implement them in your app.
Retrieving the list of paired devices
It’s possible that the user may want to connect to a device that they’ve already discovered, so you should always check the list of devices that the user has previously connected to, before looking for new devices.
You retrieve this list by calling the getBondedDevices method, which will return a set of BluetoothDevice objects representing devices that are paired to the local adapter. You can then capture each device’s unique public identifier (using getName) and its MAC address (using getAddress) and present this information to the user.
In the following snippet I’m checking for a list of paired devices and then retrieving information about each device in this list. Since you’ll eventually want to display this information to the user, I’m also laying the groundwork for adding these details to a ListView, so the user will be able to select the device they want to connect to.
Discovering new devices
If you’ve queried the list of paired devices and either a) didn’t find any devices or b) the user chose not to connect to any of these known devices, then you’ll need to look for new devices to connect to.
At this point you have two options: either make the local device discoverable and wait for an incoming discovery request, or take the initiative and issue a discovery request yourself.
Entering discoverable mode
If you want the local device to accept incoming connection requests, then you’ll need to issue a dialogue requesting that the user makes their device discoverable. You do this, by calling startActivityForResult(Intent, int) with the ACTION_REQUEST_DISCOVERABLE intent.
Once the user responds to this dialogue, the system will call the onActivityResult method and pass the requestCode and the resultCode. This resultCode will either be:
- RESULT_OK. The device is now discoverable. This field also contains information about how long the device will be discoverable for.
- RESULT_CANCELED. The user decided not to make their device discoverable, or an error occurred.
Let’s take a look at an example:
By default a device will remain discoverable for 120 seconds, but you can request a different duration using the EXTRA_DISCOVERABLE_DURATION field and an integer value, as I’ve done in the above code. If you do include the EXTRA_DISCOVERABLE_DURATION field, then the maximum value you can use is 3600 – try to use anything higher, and EXTRA_DISCOVERABLE_DURATION will default to 120.
You should also never set EXTRA_DISCOVERABLE_DURATION to 0 as this will make the device permanently discoverable, which is a great way of draining the user’s battery and potentially compromising their privacy to boot.
Issuing a discovery request
Alternatively, your app can tell the local device to go looking for new devices to connect to, by issuing a discovery request.
Your app can start the discovery process, by calling the startDiscovery method. Since the discovery process is asynchronous, it’ll immediately return a boolean value that you can use to inform the user whether discovery was started successfully.
To ensure your app gets notified whenever a new device is discovered, you’ll need to register a BroadcastReceiver for the ACTION_FOUND intent.
The onDestroy looks like this:
Discovery consumes a lot of the Bluetooth adapter’s resources, so you should never attempt to connect to a remote device while discovery is in progress – always call cancelDiscovery before attempting to connect to a remote device.
Device discovery also significantly reduces the bandwidth available for any existing connections, so you should also never launch discovery while the local device is still connected to another device, as this existing connection will experience reduced bandwidth and high latency as a result.
Making the connection
Once the user has found the device they want to connect to, it’s finally time to create a Bluetooth connection.
Bluetooth follows the client-server model, where one device acts as the server and the other acts as the client. How your app connects to a remote device will vary depending on whether the local device is acting as the server or the client:
- The server. The device uses a BluetoothServerSocket to open a listening server socket and wait for incoming connection requests. Once the server accepts a connection request, it’ll receive the client’s BluetoothSocket information.
- The client. This device uses the BluetoothSocket to initiate an outgoing connection. Once the server accepts the client’s connection request, the client will provide the BluetoothSocket information.
Once the server and the client have a connected BluetoothSocket on the same RFCOMM channel, your app is ready to start communicating with the remote device.
Note that if these two devices haven’t been paired previously, then the Android framework will automatically display a pairing request as part of the connection procedure, so this is one thing you don’t have to worry about!
In this section we’re going to look at how to establish a connection from both sides of the equation: when the local device is functioning as the client, and when the local device is functioning as the server.
Client
To initiate a connection with a remote “server” device, you need to obtain a BluetoothDevice object and then use it to acquire a BluetoothSocket. You do this, by calling createRfcommSocketToServiceRecord(UUID), for example:
BluetoothSocket socket = bluetoothDevice.createRfcommSocketToServiceRecord(uuid);
The UUID (Universally Unique Identifier) parameter is a standardized 128-bit format string ID that uniquely identifies your app’s Bluetooth service. Whenever a client attempts to connect to a server, it’ll carry a UUID that identifies the service it’s looking for. The server will only accept a connection request if the client’s UUID matches the one registered with the listening server socket.
You can generate a UUID string using an online UUID generator, and then convert that string to a UUID like this:
When you call the createRfcommSocketToServiceRecord(UUID) method, the UUID passed here must match the UUID that the server device used to open its BluetoothServerSocket.
After you’ve completed these steps, your app can initiate an outgoing connection request by calling the connect() method. The system will then perform a Service Discovery Protocol (SDP) lookup on the remote device and search for a service that has a matching UUID. If it finds this service then a connection will be established over a shared RFCOMM channel. Note that the connect() method will block the current thread until a connection is either accepted or an exception occurs, so you should never run connect() from the main UI thread.
If the connection fails, or the connect() method times out, then the method will throw a
RFCOMM can only support one connected client per channel at a time, so once you’re done with your BluetoothSocket you’ll typically want to call close(). This will close the socket and release all its resources, but crucially it won’t close the Bluetooth connection that you’ve just made to the remote device.
Server
In this scenario, both devices have a server socket open and are listening for incoming connections. Either device can initiate a connection, and the other device will automatically become the client.
To setup the local device as a server, your app needs to acquire a BluetoothServerSocket, by calling listenUsingRfcommWithServiceRecord. For example:
The listenUsingRfcommWithServiceRecord method takes two parameters. We’ve already looked at the UUID, and the string parameter is just the name of your service. This name is arbitrary, so you may want to use the name of your application. The system will automatically write this string to a new SDP database entry on the local device.
At this point, the server device will be able to start listening for incoming connection requests by calling the accept() method. Note that accept will block any other interaction until either a connection has been accepted or an exception has occurred, so you shouldn’t execute accept() on the main UI thread.
Once the server has accepted an incoming connection request, accept() will return a connected BluetoothSocket.
Again, RFCOMM will only allow one connected client per channel, so you should make sure you’re not unnecessarily hogging system resources by calling close() on the BluetoothServerSocket once you’ve acquired a BluetoothSocket.
Transferring data
Once the server device and client device each have a connected BluetoothSocket, your app is ready to start communicating with the remote device.
The specifics will vary depending on how you want your app to use its newly-forged Bluetooth connection, but as a rough guideline, you transfer data between two remote devices by completing the following steps:
- Call getInputStream and getOutputStream on the BluetoothSocket.
- Use the read() method to start listening for incoming data.
- Send data to a remote device by calling the thread’s write() method and passing it the bytes you want to send.
Note that both the read() and write() methods are blocking calls, so you should always run them from a separate thread.
Wrapping Up
Armed with this information, you should be ready to create applications that can access the device’s Bluetooth hardware and software, and use it to discover and connect with other Bluetooth-enabled devices in the local area.
Let us know in the comments how you plan on using Android’s Bluetooth support in your own apps!
Источник