Package com.google.glass.companion.Proto

Examples of com.google.glass.companion.Proto.Envelope


                mInStream = mStreamConnection.openInputStream();
                mGlassReaderThread = new GlassReaderThread();
                mGlassReaderThread.start();

                // handshaking
                Envelope envelope = CompanionMessagingUtil.newEnvelope();
                envelope.timezoneC2G = TimeZone.getDefault().getID();
                write(envelope);

                try {
                    Thread.sleep(300);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

                // handshaking
                Envelope envelope2 = CompanionMessagingUtil.newEnvelope();
                GlassInfoRequest glassInfoRequest = new GlassInfoRequest();
                glassInfoRequest.requestBatteryLevel = true;
                glassInfoRequest.requestStorageInfo = true;
                glassInfoRequest.requestDeviceName = true;
                glassInfoRequest.requestSoftwareVersion = true;
View Full Code Here


                JOptionPane.ERROR_MESSAGE);
    }

    @Override
    public void onConnectionOpened() {
        Envelope envelope = CompanionMessagingUtil.newEnvelope();
        ScreenShot screenShot = new ScreenShot();
        screenShot.startScreenshotRequestC2G = true;
        envelope.screenshot = screenShot;
        mGlassConnection.write(envelope);
    }
View Full Code Here

    @Override
    public void onMouseEvent(int action, int x, int y, long downTime) {
        MotionEvent glassMotionEvent = GlassMessagingUtil.convertMouseEvent2MotionEvent(action, 100.0f * (float) x
                / (float) mScreencastPanel.getWidth(), 100.0f * (float) y / (float) mScreencastPanel.getHeight(),
                downTime);
        Envelope envelope = CompanionMessagingUtil.newEnvelope();
        envelope.motionC2G = glassMotionEvent;
        mGlassConnection.writeAsync(envelope);
    }
View Full Code Here

            return f;
        }
    }

    public static final Envelope newMotionEventEnvelope(MotionEvent e) {
        Envelope envelope = CompanionMessagingUtil.newEnvelope();
        envelope.motionC2G = e;
        return envelope;
    }
View Full Code Here

        return res;
    }

    public static Envelope createTimelineMessage(String text) {
        long now = System.currentTimeMillis();
        Envelope envelope = CompanionMessagingUtil.newEnvelope();
        TimelineItem timelineItem = new TimelineNano.TimelineItem();
        timelineItem.id = "com.polysfactory.glassremote.timeline.sample";
        timelineItem.title = "From " + App.NAME;
        timelineItem.text = text;
        timelineItem.creationTime = now;
View Full Code Here

    private class GlassReaderThread extends Thread {
        public void run() {
            try {
                while (!Thread.currentThread().isInterrupted()) {
                    try {
                        Envelope envelope = (Envelope) GlassProtocol.readMessage(new Envelope(), mInStream);
                        if (App.DEBUG) {
                            if (envelope.screenshot == null) {
                                System.out.println("read:" + envelope);
                            }
                        }
View Full Code Here

        JButton sendButton = new JButton("SEND_TO_TIMELINE");
        sendButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                String text = textArea.getText();
                Envelope envelope = GlassMessagingUtil.createTimelineMessage(text);
                mGlassConnection.write(envelope);
            }
        });

        final JButton tapButton = new JButton("TAP (⇧⏎)");
View Full Code Here

TOP

Related Classes of com.google.glass.companion.Proto.Envelope

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.