google glass send or share binary data using GDK - google-glass

I develop a glassware that can produce binary data. The data format may be Audio or Video and it will be stored on SdCard. After these data has been created, I want to share it easily with other people or send email with an attachment to them.
So, I use the standard Android API (Intent.ACTION_SEND_MULTIPLE|Intent.ACTION_SEND)to send email, but an error occured :
Is there any way to share binary data with others on Google glass through GDK?
Mirror API can do this?

As of now, GDK does not support action send and share yet.
A feature request has been submitted here and here.
See How to send email via Glass
You have to use JavaMail API.
Sending Email in Android using JavaMail API without using the default/built-in app

Related

How to use FCM pkg on Django?

I'm using the fcm_django package to send notifications API to Firebase but I have some confusion about those two concepts on Firebase like so: (registeration_id and device_id)
https://fcm-django.readthedocs.io/en/latest/#setup
I placed the "server_key" of Firebase to registration_id but don't understand what does device_id means and what is the value I should put on it?
after answering the above questions I tried to send notification from Django by the admin page on Django by creating registration_id which is "server_key" and defining the type which is a "web", but when I created this object I didn't see any message has been sent to Firebase cloud.
Note:-
I want to send notifications to only one device not many users.
so, can anyone help me to achieve this mission succeeded?
Thanks in advance
The device_id is a token that is generated by the Firebase SDK on each device/app combination that wants to receive messages from FCM.
To learn how to access this token, have a look at the documentation for Android, Web and iOS.
Once you have the token on the specific client, you will need to send it to a place where the fcm-django package can then also access it; typically a cloud hosted database, such as the Realtime Database or Firestore that are also part of Firebase.
From there your Django can then get the token, and pass it to the fcm-django API.

RapidSMS Twilio Django - SMS Application Architecture

I am learning SMS application dev with RapidSMS Django. I came across rapidsms-twilio for backend. I am lost here and trying to make sense of overall architecture and technologies associated with each layer. It will help me in future research of better alternatives. Similar to web applications JS/Ajax/css/html are front end tech with java in app layer and db on backend how could i layout SMS application framework?
From my understanding Twilio will provide a number so whenever text is received on number it will receive it in SMMP format and convert it to HTTP and call app server URL mapped against it which could be in django. Where and what does rapidsms do here?
Twilio developer evangelist here.
I have never used RapidSMS, but as far as I can tell, it does the handling and sending of SMS via a chosen backend processor that receives and sends SMS messages. It comes with some built in backends, like Kannel which is an SMS gateway, but there are third party backends available too.
rapidsms-twilio is a third party backend that allows you to use RapidSMS as the dashboard/user interface and send and receive messages via Twilio

Request data from my Google Glass to Mirror API?

Since you canĀ“t do all the nice looking stuff with the GDK at this point (html, images and so on) on cards. I was wondering if there is a possibility to ask a Mirror API from within my application (created with GDK) to send me some data?
Example:
I see the flow like this:
The GDK app is started with "ok glass, search app"
You talk what you want to search for.
The app takes the word and asks the Mirror API for a result.
The Mirror API sends the result to the glass timeline.
Regards
Joakim
Absolutely. If it makes sense for your app to either communicate with an external service that sends data back via the Mirror API, or calls the Mirror API itself, then you can certainly do so. (Although you begin getting dangerously close to just doing it all in Mirror at that point.)
The biggest challenge you'll face is having your app go through the OAuth dance to get an auth token to use.
It sounds like the core of your issues is that you want a richer way to display content in the static part of the timeline to the right of the clock. You have a couple of options.
GDK
If you'd like to stay pure GDK, you can create your own view, and flatten it into a bitmap. The steps to complete this are the same as for other Android devices.
Mirror API
You could also use the Mirror API to insert HTML static cards using timeline's insert method, but to do this you will need to communicate some authentication information to your GDK Glassware. For example, if you want to insert into the Mirror API directly from Glass, you would need a way to provide an access and refresh token to your GDK Glassware.
There is no graceful way to do this with the released APIs, but I've seen some people accomplish this using the OAuth 2.0 flow for devices or scannable QR codes.
If you go down this route, be prepared to update your implementation. Google has announced improved support for sending authentication information to GDK Glassware. Once it's available you will want to switch over to it.
Mirror API allow you to communicate back to it from Glass through the contact that you can create using Mirror API.
How it works -
you create a contact,
then when you need to do wit GDK on step 2 of your flow is share a
note with your contact
the words get transcribed and delivered to you Mirror notification
listener.
the mirror notification listener on server get the text of what kind
of app you would like to search, perform the search and deliver the
result by simply publishing on your timeline.
That's the best that i can see right now.
Here is a link how to declare voice menu commands (now only two are available, but you can propose more)
https://developers.google.com/glass/develop/mirror/contacts#declaring_voice_menu_commands
P.S. To go through oauth2 challenge - download sample mirror app
https://developers.google.com/glass/samples/mirror edit you
oauth2.properties file with creds you will get on your google development web console (you will need to create the app with google and request to enable Mirror API)
then run mvn clean install
then run
mvn jetty:jetty

How would I call a web-service from Google Glass

I was exploring Google glass. From the dev guides it is clear that to call web services I need to Mirror Apis. But mirror APIs seems to me a platform that helps inserting cards into Glass timeline from remote location.
Can Mirror API help me to get the data from some remote server and return a JSON or XML response ? Or Otherwise via Mirror API I need to parse the response and prepare a Card there to push it to Glass Timeline.
Anyone please help me out on this query.
Neither API, Mirror or GDK, will actually do the work of calling the remote server and getting a response - those are normal things that you should be able to do with the underlying tools they are built on (whatever platform you choose to develop with, if you're using Mirror, or Android if you're using the GDK).
What both APIs support, however, is helping you deliver that information to Glass in the most appropriate way possible.
The Mirror API is good for Glassware that is accessed over the Internet and work with the native timeline operations that Glass provides. The GDK is useful for more immersive or dynamic applications that don't necessarily work with the timeline or the network.
It's the second one: Otherwise via Mirror API I need to parse the response and prepare a Card there to push it to Glass Timeline. . This answer discusses the notion of accessing web services from the Mirror API, but to answer your question, your web server will need to get and parse the XML/JSON data, create a card (using the data) and push it to your Glass device.

Secure messaging using Secure MIME is it reliable?

We have an automatic reporting and notification system written in .net that sends emails with plain text. We are having to encrypt the messages that we send our clients.
The possible implementation approaches we have:
Send messages as S/Mime email with attachments.
Plain text email with that just contains a link to a web site that will display the message over https.
It seems like S/Mime is a simpler solution, as we won't need to create the web application or secure it.
Our concern is our interoperability with our clients email clients and more importantly their email filtering software.
Has anyone had success or issues deploying a Secure MIME messaging solution?
Given the wealth of different clients people use these days for email, like BlackBerry, Iphone, Android, Samsung, Nokia, Thunderbird, Outlook (Express), Apple Mail, web mail etc, I would go for the web application over https. It does take an extra step of clicking the link, and logging in, but it could be used from a lot more devices without extra configuration steps.
How are you going to solve the problem of provisioning the destination certificates? If you send mail to 1000 users, you need to send it 1000 times, and each time use a different public key, the one for the current destination (so that only he/she can decrypt it and read it). Having each individual report final user create a key for himself and send you the associated public key so you can associate the report mail with it is problematic. Some PKI infrastructure products can help, but only inside a (tighly run) organization.
Securing only your web site seems easier to manage, since you'll have all the ends under your control. You still have to handle authentication, but that can be handled at the HTTP level (eg. Digest, or even Basic over HTTPS).
SideNote: (you can edit this in an answer) Not all mobile clients support SMIME. sadly the native android mail client (on Nexus 4, Nexus 5 etc...) does not support S/MIME . also, I personally have issues with the samsung galaxy SMIME support. Best (external and paid for...) solution I have found so far for android is MySecuredMail.