Android 如何获得共享Glympse链接?

Android 如何获得共享Glympse链接?,android,glympse,Android,Glympse,我必须使用Glympse实现实时跟踪。在Glympse应用程序中,您可以共享一个链接,该链接将显示您当前的位置。现在,我必须获得该链接并将该链接发送到服务器。我正在搜索它,但我无法得到想要的解决方案,以获得该链接 我从链接中得到了一些例子 GLYMPSecreteDemo展示了获取链接所需的步骤,但这里是关键部分 // Create the ticket for the given duration. GTicket ticket = GlympseFactory.createTicket(du

我必须使用Glympse实现实时跟踪。在Glympse应用程序中,您可以共享一个链接,该链接将显示您当前的位置。现在,我必须获得该链接并将该链接发送到服务器。我正在搜索它,但我无法得到想要的解决方案,以获得该链接


我从链接中得到了一些例子

GLYMPSecreteDemo展示了获取链接所需的步骤,但这里是关键部分

// Create the ticket for the given duration.
GTicket ticket = GlympseFactory.createTicket(duration, null, null);

// For the recipient list, we create a single "LINK" recipient. This
// means we want a recipient URL for the new Glympse without having
// the Glympse API actually send the invite out to anyone.
GInvite recipient = GlympseFactory.createInvite(GC.INVITE_TYPE_LINK, null, null);
ticket.addInvite(recipient);

// Call sendTicket to create the ticket and the recipient URL.
_glympse.sendTicket(ticket);
侦听链接何时可用

// The object you pass to this method must implement GEventListener
// In the demo this is done in GlympseCreateDemoActivity.java
ticket.addListener(this);

// Once the invite is ready you will get this event
@Override public void eventsOccurred(GGlympse glympse, int listener, int events, Object obj)
{
    if (GE.LISTENER_TICKET == listener)
    {
        if (0 != (events & GE.TICKET_INVITE_CREATED))
        {
            GTicket ticket = (GTicket) obj;
            // This string will contain the link that you can send to your server
            String theUrlLink = ticket.getInvites().at(0).getUrl();
        }
    }
}

GlympSecreteDemo展示了获取链接所需的步骤,但以下是关键部分

// Create the ticket for the given duration.
GTicket ticket = GlympseFactory.createTicket(duration, null, null);

// For the recipient list, we create a single "LINK" recipient. This
// means we want a recipient URL for the new Glympse without having
// the Glympse API actually send the invite out to anyone.
GInvite recipient = GlympseFactory.createInvite(GC.INVITE_TYPE_LINK, null, null);
ticket.addInvite(recipient);

// Call sendTicket to create the ticket and the recipient URL.
_glympse.sendTicket(ticket);
侦听链接何时可用

// The object you pass to this method must implement GEventListener
// In the demo this is done in GlympseCreateDemoActivity.java
ticket.addListener(this);

// Once the invite is ready you will get this event
@Override public void eventsOccurred(GGlympse glympse, int listener, int events, Object obj)
{
    if (GE.LISTENER_TICKET == listener)
    {
        if (0 != (events & GE.TICKET_INVITE_CREATED))
        {
            GTicket ticket = (GTicket) obj;
            // This string will contain the link that you can send to your server
            String theUrlLink = ticket.getInvites().at(0).getUrl();
        }
    }
}

在分享了一首歌之后。我们在状态栏上有一个图标,显示共享Glympse的状态。我们可以将其从状态栏(通知)中删除吗?可以阻止这些通知。GlympseService.启用glympsenotifications(错误);必须在调用Glympse平台上的start()之前调用此函数。在我的应用程序中,我已将链接发送到服务器,而不是朋友。是否有任何方法可以使用RestAPI(即post api)直接发送glympse链接?或者谁可以是Glympse位置链接的收件人?我可以与服务器共享链接吗?在共享Glympse之后。我们在状态栏上有一个图标,显示共享Glympse的状态。我们可以将其从状态栏(通知)中删除吗?可以阻止这些通知。GlympseService.启用glympsenotifications(错误);必须在调用Glympse平台上的start()之前调用此函数。在我的应用程序中,我已将链接发送到服务器,而不是朋友。是否有任何方法可以使用RestAPI(即post api)直接发送glympse链接?或者谁可以是Glympse位置链接的收件人?我可以与服务器共享链接吗?