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

how to communicate two android app using android java or c# xamarin?

jackraj25

Lurker
Hi Friends,
Is there is any possibility, that an android Services(Name is CountServcies app) can continuously run to watch my Student registration app(Name is StudentRegistration app) ...........?????

Purpose
1. Android Services(CountServcies app) app need to send SMS to HOD for every day at 4 pm. The SMS should contain the particular day student registered count is Student Registration app.
2. If both apps are installed on a device, although the service app is not launched it should send the SMS.


If you got the solution na...........please let me know..............it'll be helpful to me.....
 
Hi Friends,
Is there is any possibility, that an android Services(Name is CountServcies app) can continuously run to watch my Student registration app(Name is StudentRegistration app) ...........?????

Purpose
1. Android Services(CountServcies app) app need to send SMS to HOD for every day at 4 pm. The SMS should contain the particular day student registered count is Student Registration app.
2. If both apps are installed on a device, although the service app is not launched it should send the SMS.


If you got the solution na...........please let me know..............it'll be helpful to me.....

Try:

To let two applications communicate with each other, check out this network-clipboard demo using JGroups. Just start two instances and begin dropping files into one of them. The second instance will instantly show the same files.

import java.io.Serializable;
import java.awt.*;
import java.awt.datatransfer.*;
import javax.swing.*;
import org.jgroups.*;

public class JGroupsTest {

public static void main(String[] args) throws Exception {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
frame.setSize(500, 300);
final DefaultListModel listModel = new DefaultListModel();
final JList panel = new JList(listModel);
panel.setBackground(new Color(128, 0, 40));
panel.setForeground(new Color(240, 240, 240));
frame.add(panel);
System.setProperty("java.net.preferIPv4Stack", "true");
final JChannel channel = new JChannel("udp.xml");
channel.connect("networkclipboard");
channel.setReceiver(new ReceiverAdapter() {
@override
public void viewAccepted(View newView) {
frame.setTitle("Network Clipboard - " + channel.getLocalAddress());
}

@override
public void receive(Message msg) {
listModel.addElement(msg.getObject());
}
});

panel.setTransferHandler(new TransferHandler() {
@override
public boolean importData(JComponent comp, Transferable t) {
DataFlavor[] transferDataFlavors = t.getTransferDataFlavors();
for (DataFlavor flavor : transferDataFlavors) {
try {
Object data = t.getTransferData(flavor);
if (data instanceof Serializable) {
Serializable serializable = (Serializable) data;
Message msg = new Message();
msg.setObject(serializable);
channel.send(msg);
}
} catch (Exception e) {
e.printStackTrace();
}
}
return super.importData(comp, t);
}

@override
public boolean canImport(TransferSupport support) {
return true;
}

@override
public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) {
return true;
}

});
}

}
 
Back
Top Bottom