Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[APP][4.1+] M2D My Second Device - Manager and Modules

OP pacosal

17th January 2014, 09:47 AM   |  #1  
pacosal's Avatar
OP Senior Member
Thanks Meter: 233
 
659 posts
Join Date:Joined: Oct 2010
Donate to Me


Hi all,

I'm working on a project to send commands between 2 devices in order to use one of them as an auxiliary gadget called My Second Device.

For example you can use your tablet to receive the notifications received in your main mobile or use a small mobile to receive the notifications received in your main mobile.

But not notifications only, with this Service Apps can exchange all kind of text messages between them and make actions in the remote device. All kind of actions that new Smartwatches like Sony Smartwatch and Samsung Galaxy Gear can be done with this project. For instance:

- Remote control of the multimedia system of your main device from your second device like play, stop, volume,...
- Make the other device to start recording sounds when you make something in your second device
- Make the other device to take pictures or videos
- Play sounds

If you have a phablet with you, why use it for all things? as the smartwatches you can use an small and cheap mobile for doing this things that you can do with your smartwatch. Why pay 300$ for a Galaxy gear with limited hardware features while you can use a small mobile cheaper and with better hardware? Take both devices with you.

If you live in an area with burglar problems, maybe is better not to show your last Samsung Galaxy Note 3 and show your Xperia U, for example.

This project has the following components so far:


- M2D My Second Device Manager for both devices

- M2D Notifications Receiver for your second device

- Voice for Notifications for your main device


Besides, other developers can take advantage of this project using M2D Manager to send action commands between their Apps and creating their own modules. Go to 3th post for details.


************************************************** *
Use m2d manager with Tasker App http://www.pacosal.com/desarrollo/20...h-m2d-manager/
************************************************** *


M2D CAR MODULE

This App works as a module of My Second Device service and needs the Voice for Notifications App in order to get Notifications.

Besides, it is an App that shows Speed, Elevation and Hour and notifications as well.

The idea is to have a dedicated device only for your car. This device must only have bluetooth and gps enabled. There is no need for wifi or sim.

You have to install:

- m2d manager in both devices (main device and car device)

- Voice for notifications in your main device (you can uncheck read notifications and this way only send notifications to your second device.

- This App in your device car.

How to proceed:

- Pair both devices by bluetooth. Run m2d manager in both devices and select main device in your car device. In a few seconds both will be connected.

If you use a tablet, you can receive notifications as well. Install m2d manager and m2d notifications receiver in your tablet and pair them as well. Select your main device in m2d manager.

Your main device will connect to one of them if is near. For example to your car device when you are in your car o to your tablet when you are at home.

https://play.google.com/store/apps/d...acosal.m2d.car

Thanks
Last edited by pacosal; 15th May 2014 at 08:13 PM.
The Following 22 Users Say Thank You to pacosal For This Useful Post: [ View ]
17th January 2014, 09:48 AM   |  #2  
pacosal's Avatar
OP Senior Member
Thanks Meter: 233
 
659 posts
Join Date:Joined: Oct 2010
Donate to Me
Download Post for other modules.

Have you developed a compatible module? Let me know and I'll post it here!

Modules in development but you can find them at Google Play already.



- m2d Media Remote Receiver
- m2d Media Remote Sender

Thanks
Last edited by pacosal; 30th January 2014 at 06:48 PM.
The Following 2 Users Say Thank You to pacosal For This Useful Post: [ View ]
17th January 2014, 09:48 AM   |  #3  
pacosal's Avatar
OP Senior Member
Thanks Meter: 233
 
659 posts
Join Date:Joined: Oct 2010
Donate to Me
Developer Post:

Want to use M2D Manager for your own modules? Get rid of bluetooth connections and leave that for M2D Manager. Focus on your App.

In order to send a message between devices, the message goes first to M2D Manager with an Intent this way:

Intent i = new Intent("com.pacosal.m2d.manager.action.MSG");
i.setPackage("com.pacosal.m2d.manager");

i.putExtra("action", "Your receiver package and filter");
i.putExtra("data", "message");

sendBroadcast(i);

************************************************** *********************************
** version 1.3.0
************************************************** *********************************
Added feature to ask m2d Manager for connection state

Register for this filter in your ExternReceiver:

<action android:name="com.pacosal.m2d.manager.action.CONNE CTION" />

and in your class use this code:

if (intent.getAction().equals("com.pacosal.m2d.manage r.action.CONNECTION")) {
connectionState = intent.getBooleanExtra("connected", false);
return;
}

If you need to know the connection state, you can ask m2d manager with this code:

Intent i = new Intent("com.pacosal.m2d.manager.action.CONNECTION_ STATE");
i.setPackage("com.pacosal.m2d.manager");
this.sendBroadcast(i);


************************************************** *********************************
** version 1.2.0
************************************************** *********************************

Added feature to send and receive binary files. Don't send binary files greater than 500.000 bytes.

To send:
intent.putExtra("binary",byte[]) ;

To receive:
byte[] dataBinary = intent.getByteArrayExtra("binary");

If you need sending greater files, send them with several messages and concatenate them.


************************************************** *********************************
** version 1.1.0
************************************************** *********************************

By default, M2D Manager stores messages if there is no connection between devices in real time, if for your App the message is only valid in real time, set the following flag. For instance for an instant action.

intent.putExtra("flagNoStore",true) ;

************************************************** *********************************

The action parameter include the filter broadcast that the receiver App must implement.
The data parameter is a String message to send to your App. Could be any String text, including json

In order to receive the message in the other App (Could be the same App) M2D Manager send an Intent with the action text you sent before that you have to register in your manifest:

AndroidManifest

<receiver android:name="your_package.ExternReceiver" >
<intent-filter>
<action android:name="Your receiver package and filter" />
</intent-filter>
</receiver>



Class

public class ExternReceiver extends BroadcastReceiver {

public void onReceive(Context context, Intent intent) {

// Do actions...

String data = intent.getStringExtra("data");

Log.D(TAG, data);

}

}

Remember including in Google Play description the sentence M2D My Second Device Module at the end in order that users can find your App from M2D Manager.

Thanks
Last edited by pacosal; 2nd February 2014 at 09:58 AM.
The Following 3 Users Say Thank You to pacosal For This Useful Post: [ View ]
17th January 2014, 11:17 AM   |  #4  
anu.cool's Avatar
Senior Member
Flag Delhi
Thanks Meter: 957
 
797 posts
Join Date:Joined: Nov 2012
More
Quote:
Originally Posted by pacosal

Galaxy Note 3 and show your Xperia U, por example.

spell mistake
concept is good,any chance of connection by internet rather than using Bluetooth,so that I can use it even when I m out?
coz otherwise I will have to be in Bluetooth range to make everything work ..
17th January 2014, 11:20 AM   |  #5  
pacosal's Avatar
OP Senior Member
Thanks Meter: 233
 
659 posts
Join Date:Joined: Oct 2010
Donate to Me
Quote:
Originally Posted by anu.cool

spell mistake
concept is good,any chance of connection by internet rather than using Bluetooth,so that I can use it even when I m out?
coz otherwise I will have to be in Bluetooth range to make everything work ..


Thanks for the mistake

The idea is wear always both devices, because the small one doesn't have SIM

Regards
The Following User Says Thank You to pacosal For This Useful Post: [ View ]
17th January 2014, 12:46 PM   |  #6  
Senior Member
Thanks Meter: 20
 
284 posts
Join Date:Joined: May 2006
Quote:
Originally Posted by pacosal

Thanks for the mistake

The idea is wear always both devices, because the small one doesn't have SIM

Regards

Pacosal my man,

Do both devices need to be running Android?
Could this happen between an iPhone and a Gear?

Thanks!
17th January 2014, 01:31 PM   |  #7  
pacosal's Avatar
OP Senior Member
Thanks Meter: 233
 
659 posts
Join Date:Joined: Oct 2010
Donate to Me
Quote:
Originally Posted by gidi

Pacosal my man,

Do both devices need to be running Android?
Could this happen between an iPhone and a Gear?

Thanks!

Sorry my friend, but only Android
The Following User Says Thank You to pacosal For This Useful Post: [ View ]
17th January 2014, 01:46 PM   |  #8  
anu.cool's Avatar
Senior Member
Flag Delhi
Thanks Meter: 957
 
797 posts
Join Date:Joined: Nov 2012
More
Quote:
Originally Posted by pacosal

Thanks for the mistake

The idea is wear always both devices, because the small one doesn't have SIM

Regards

I don't know anything about coding and all,but it maybe possible to take the app to a whole new level if net connection is possible,like checking on baby when you are out(you can click picture,upload it on cloud and then check it),using your other mobile to use as camera and many more examples ... we can always connect other mobile through wifi!
I am half dead atm(sleepy I mean) so can't really think much,but do give it a thought...
18th January 2014, 07:49 PM   |  #9  
pacosal's Avatar
OP Senior Member
Thanks Meter: 233
 
659 posts
Join Date:Joined: Oct 2010
Donate to Me
version 1.1.0
- New options for developers for not to store messages not sent if there is no connection in that moment.

By default, M2D Manager stores messages if there is no connection between devices in real time, if for your App the message is only valid in real time, set the following flag. For instance for an instant action.

intent.putExtra("flagNoStore",true) ;
The Following User Says Thank You to pacosal For This Useful Post: [ View ]
24th January 2014, 11:12 AM   |  #10  
pacosal's Avatar
OP Senior Member
Thanks Meter: 233
 
659 posts
Join Date:Joined: Oct 2010
Donate to Me
Version 1.2.0 out!

Added feature to send and receive binary files. Don't send binary files greater than 500.000 bytes.

To send:
intent.putExtra("binary",byte[]) ;

To receive:
byte[] dataBinary = intent.getByteArrayExtra("binary");

If you need sending greater files, send them with several messages and concatenate them.

**

The Following User Says Thank You to pacosal For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes