Glympse - How to create private groups in android? - glympse

I am checking glympse android sdk. I am not able to find programming guide for how to create private groups in android. There is reference of REST api for creating private groups using cards. But there is no step by step guide for it. Can anyone guide how to create private groups using android glympse sdk.

The private groups documentation is still under construction since it's a brand new feature. I'd be happy to get you started with some example code.
To use private groups you'll be using the Cards feature of the SDK. To enable this feature, you have to make a small configuration change before starting the Glympse platform.
GConfig config = glympse.getConfig();
config.setCardsEnabled(true);
...
glympse.start();
After the platform is started, you'll be able to join/manage private groups using the CardsManager
// Create a private group
GCardManager cardManager = glympse.getCardManager();
GCard card = GlympseFactory.createCard("559364b74d76b03a2f46096e", name);
boolean result = cardManager.createCard(card);
// Note: 559364b74d76b03a2f46096e is a constant that refers to a private group type card.
// Currently it is the only type of card available. A list of types returned from the server
// can be obtained through cardManager.getCardTypes()
// Invite someone to join a private group
GInvite invite = GlympseFactory.createInvite(GC.INVITE_TYPE_SMS, "A friend", "555-555-1234");
GCardInvite cardInvite = GlympseFactory.createCardInvite(invite);
card.sendCardInvite(cardInvite);
There is also reference documentation available
https://developer.glympse.com/docs/core/client-sdk/reference/android/GCardManager
https://developer.glympse.com/docs/core/client-sdk/reference/android/GCard
etc. Everything GCard related is used for private groups.

Related

Recognize the user input inside the handler function using dialogflow.ai/api.ai and Microsoft Bot Builder

I am building a bot using the given technology stacks:
Microsoft Bot Builder
Node.js
Dialogflow.ai (api.ai)
We used waterfall model to implement a matched intent Dialog, which includes a couple of handler functions and prompts. After following this scenario I need to identify the entities inside an inner handler function, for a user input.
eg:
Bot : Where do you want to fly?
User: Singapore. (For this we added entities like SIN - Singapore,SIN(Synonym), So I need to resolve the value as SIN)
Any help on this scenario is much appreciated.
Here is a post Using api.ai with microsoft bot framework you can refer for your reqirement, and with a sample at https://github.com/GanadiniAkshay/weatherBot/blob/master/api.ai/index.js. The weather api key leveraged in this sample is out of date, but the waterfall and recognizer api key is still working.
Generally speaking:
Use api-ai-recognizer
Instantiate the apiairecognizer and leveraged builder.IntentDialog to include the recognizer:
var recognizer = new apiairecognizer("<api_key>");
var intents = new builder.IntentDialog({
recognizers: [recognizer]
});
In IntentDialogs, use builder.EntityRecognizer.findEntity(args.entities,'<entity>'); to recognize the intent entities.

new RoleManager<IdentityRole> error missing arguments in VS 2015

I want to implement User and Role Manager in VS 2015 using the Identity.EntityFramework": "3.0.0-rc1-final".
Among others I have created a class IdentityManager.
My main problem is creating a method to check the existence of a Role as follows.
public bool RoleExists(string name)
{
var RoleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(new ApplicationDbContext()));
return RoleManager.RoleExists(name);
}
I keep getting the error on new RoleManager<IdentityRole>:
There is no argument given that corresponds to roleValidators, keyNormalizer, errors, logger,contextAccessor"
Yes, basically all the parameters I am not specifying but I have no idea how to approach these.
I am very new at this and have been searching and trying for days now, if someone can just point me in the right direction I am willing to do the legwork and testing, I just need some documentation.
I am having a similar issue - it looks like the roles are not the best option in identity 3.0
This thread (ASP .NET 5 MVC 6 Identity 3 Roles Claims Groups) helped me get something working, but its sad that this is not better documented.
Here are my attempts at improving that. Asp.net.Identity (3.0.0.0-rc1-final)
in Startup.cs --> ConfigurationServices
//Define your policies here, they are strings associated with claims types, that have claim strings...
//they need to be in AspNetUserClaims table, user id, department, Dev to be allowed access to the Dev policy
//add the auth option, below that makes it work, and in the api controller, add the
//[Authorize("Dev")] attribute
//services.AddAuthorization(
// options =>
// {
// options.AddPolicy("Dev", policy => { policy.RequireClaim("department", "Dev"); });
// });

How to retain data even after app is closed in windows phone?

In my app i'm having two variables, which i want to retain even after my application is closed.
Which would be the right way to accompolish it?
You can store the values in an IsolatedStorage. There is a very nice article on MSDN regarding the persistance of information on Windows Phone. You can read it here http://msdn.microsoft.com/en-us/library/gg680266(v=pandp.11).aspx
The example shown by Microsoft looks something like this:
private const string CAR_PHOTO_FILE_NAME = "CarPhoto.jpg";
private const string CAR_KEY = "FuelTracker.Car";
private static readonly IsolatedStorageSettings appSettings =
IsolatedStorageSettings.ApplicationSettings;
public static void SaveCar(Action errorCallback)
{
try
{
appSettings[CAR_KEY] = Car;
appSettings.Save();
DeleteTempCarPhoto();
SaveCarPhoto(CAR_PHOTO_FILE_NAME, Car.Picture, errorCallback);
NotifyCarUpdated();
}
catch (IsolatedStorageException)
{
errorCallback();
}
}
The process of reading the information is very much the same. Go through the article and adopt it for your own needs.
There are a number of different storages available on Windows Phone 7.x as well as Windows Phone 8
If these two values of yours are settings, you want to preserve, I recommend you to use the IsolatedStorageSettings. This is a simple key / value store to save and load variables after restart your app. See the the following sample of MSDN (How to create settings)
See a list of other API's and samples on when and how to use it here (Data for Windows Phone on MSDN)

Retrieve all groups for a member using Google Admin java sdk

I would like to retrieve all groups for a given member.
There is an api interface for this:
https://developers.google.com/admin-sdk/directory/v1/guides/manage-groups#get_all_member_groups
But unfortunately I can't figure out how to do that using java SDK as I was not able to find a method for this.
How can this problem be solved?
You don't need to add methods, you can use Directory.Groups.List and set the userKey parameter, something like
//... imports, initializations etc.
Directory service = new Directory.Builder(httpTransport, jsonFactory,
credential).build();
Groups userGroups = service.groups().list().setUserKey("member#domain.com")
.execute();
Add new method to class com.google.api.services.admin.directory.Directory class to query https://www.googleapis.com/admin/directory/v1/groups?userKey={userKey}. This way you can retrieve the member's groups.

Launcher and Chooser in Windows Phone 7

I am not able to find a way (even with Mango SDK) in which I can show a chooser (say PhoneNumberChooserTask), and get all details about a contact...
Only Name and PhoneNumber is available. For other information like address, I have to use a different chooser. Is there any way in which I can show a chooser (anyone) and get all details...
Phone number
Email address
Photo of the contact
etc.
let me clarify the issue here...
The following code will not work. I want to show a chooser in such a way that it grabs all details. Showing multiple choosers, as I said is not what I want. Imagine asking someone to choose the same contact 3 times to get Email, PhoneNumber and Address.
EmailAddressChooserTask ect = new EmailAddressChooserTask();
ect.Completed += new EventHandler<EmailResult>(ect_Completed);
ect.Show();
PhoneNumberChooserTask pct = new PhoneNumberChooserTask();
pct.Completed += new EventHandler<PhoneNumberResult>(pct_Completed);
pct.Show();
AddressChooserTask act = new AddressChooserTask();
act.Completed += new EventHandler<AddressResult>(act_Completed);
act.Show();
In v7.1 (Mango) you can use the Contacts class. You can use the SearchAsync method providing whatever search criteria you want (DisplayName is the most likely) and then handle the SearchCompleted event and use the ContactsSearchEventArgs.Results to access the returned Contact objects.
From there, you can use the GetPicture method to retrieve the contact image, and the various properties of the Contact object to access all the other information.
Hopefully that will get you started. You can find more information in the Microsoft.Phone.UserData namespace.
I think you can do this with the following tasks:
AddressChooserTask
EmailAddressChooserTask
PhoneNumberChooserTask

Resources