AdColony Aurora Android 3.0 SetCustomID - java

I'm attempting to integrate AdColony into an app. I'd like to set a custom ID for each user that gets passed back in the server to server callback I can setup in their dashboard. Right now the custom ID field returns null because it isn't set.
From what I can tell in their new java docs, they seem to have removed the setCustomID call from the AdColony class - or just overlooked it.
Their old docs for 2.3.6 have a built in method that makes it easy to do.

Apparently the name has changed to setUserID() and is now located on the AppOptions object. So you can do it like this:
AdColonyAppOptions options = new AdColonyAppOptions();
options.setUserID("MY USER ID");
AdColony.configure(this, options, "MY APP ID", "MY ZONE ID");

Related

How to use intent.setData() for changing system settings?

I discovered this code online that sends the user directly to the where they need to change the app's system write settings:
Intent writePermission = new Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS);
writePermission.setData(Uri.parse("package:" + MainActivity.this.getPackageName()));
MainActivity.this.startActivityForResult(writePermission, 4);
I want to do the same thing but for an accessibility service. I have this code here but it's lacking the second line of the above code that sends the user to the needed service:
Intent changeSettings = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
startActivityForResult(changeSettings, 2);
I want to send the user directly to WindowChangeDetectingService rather than have them look it up in a list.
I discovered this code online that sends the user directly to the where they need to change the app's system write settings
That optional Uri is covered in the documentation for that Intent action.
I want to do the same thing but for an accessibility service.
The documentation for ACTION_ACCESSIBILITY_SETTINGS does not indicate that there is such an option.

How to add Cards to microsoft teams bot using Bot Framework SDK for Java?

I'm using the Java botbuilder to build a microsoft teams bot. I want to add Cards to my bot (e.g. to embed links, quick replies, and images).
In the above link it says: suggested actions are not supported in Microsoft Teams: if you want buttons to appear on a Teams bot message, use a card.
However, I can find no documentation on how to add a 'card' to the Activity schema.
I tried:
1. Using suggested actions
I tried adding my List<CardAction> to the SuggestedActions
field in Activity but they were not rendered by microsoft teams
(as expected, the documentation says this is not supported).
2. Using Attachments
I suspect it could be done using attachments, but can only find
documentation for the C#/JS versions (e.g.
https://learn.microsoft.com/en-us/azure/bot-service/nodejs/bot-builder-nodejs-send-rich-cards?view=azure-bot-service-3.0).
So I want to know how to add 'a card' to Activity schema so it can be rendered by my bot.
The BotFramework Java SDK is still in preview, so there isn't a lot of documentation I can point you towards. However, here is an example of adding a HeroCard to a reply.
Activity reply = new Activity()
.withType(ActivityTypes.MESSAGE)
.withRecipient(activity.from())
.withFrom(activity.recipient())
.withAttachments(Arrays.asList(
new Attachment()
.withContentType("application/vnd.microsoft.card.hero")
.withContent(new HeroCard()
.withTitle("Hero Card")
.withSubtitle("BotFramework")
.withButtons(Arrays.asList(new CardAction()
.withValue("https://learn.microsoft.com/en-us/azure/bot-service/")
.withTitle("Get started")
.withType(ActionTypes.OPEN_URL)
))
.withImages(Collections.singletonList(new CardImage()
.withUrl("https://sec.ch9.ms/ch9/7ff5/e07cfef0-aa3b-40bb-9baa-7c9ef8ff7ff5/buildreactionbotframework_960.jpg"))))
));
You can also take a look at the SDK Attachment Tests for more examples.
Hope this helps!

Liferay - Set guest permission on custom field/expandocolumn

I've successfully added a custom field to the User Sign-up page (create_account.jsp) by creating an expando column via Hook plugin. However, the field is not visible until I enable Guest permissions on it through the admin UI.
I need to be able to do this programmatically, through the Hook plugin. Exhaustive research leads me to believe that the following code should do the trick:
Role guest = RoleLocalServiceUtil.getRole(companyId, RoleConstants.GUEST);
ResourcePermissionLocalServiceUtil.setResourcePermissions(
companyId,
ExpandoColumn.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(expandoColumn.getColumnId()),
guest.getRoleId(),
new String[] { ActionKeys.VIEW, ActionKeys.UPDATE });
But it doesn't.
Anyone got any ideas?
I tried same code as yours and it worked for me. In my opinion the problem is in "expandoColumn.getColumnId()". How do you retreive object ExpandoColumn? I tried with with table id and name:
ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil.getColumn(21806, "Menu");
For this try i retreive the table id directly from DataBase, from table "expandocolumn"

Cannot insert object in Parse.com with parse4j API in JAVA

I am using Parse.com for communicating with iOS application and Web Browser. I have registered in parse.com and created an application. Now I have an iOS application ready to insert an object in that application which is working fine. Now comes the backend part, I am using JAVA for web application. Now,
https://parse.com/docs/api_libraries
According to this link, I can see the API/ Libraries I can use in JAVA is
Almonds
mobile-parse-api
Parse4j
ParseFacade
Among this 4, I have selected Parse4j to build web application with.
I am using Eclipse, I have installed GWT plugin, created a web application. Now I am adding this parse4j.jar file to that project, Added it to the build path also. And then I try to write this code
try {
Parse.initialize("my app id", "my rest app id");
ParseObject gameScore = new ParseObject("GameScore");
gameScore.put("score", 1337);
gameScore.put("playerName", "Sean Plott");
gameScore.put("cheatMode", false);
gameScore.save();
return "OK";
} catch(IllegalArgumentException e){
e.printStackTrace();
return "KO";
}
catch(ParseException e){
e.printStackTrace();
return "KO";
}
It doesn't insert the object to parse cloud. Please help why isn't working? Am I missing anything to write?
As far as I see, the code is correct. However, if Parse4j does not save the entry
this means that you write wrong the attribute name or class name. Just check the names
and class name then reply back.
Regards.
One way to validate is the do a Query, get the object and print all the attributes / data types. Then store these as static class level constants and use them throughout your class for setting values in new objects to persist.
If the get query doesn't work (without any filters), which means your class name is incorrect.
Good Luck!

Google Calendar

I'm developing one web application project using java for education industry.In this Admin have all rights to access the google services of other users like A,B,C..... for this is use OAuth.Then i tried Admin want to share user A's calendar to user B using OAuth.But i got stuck in this step. Is it possible Plz Help me
Thanks
Regards
Sharun
I believe you want to use Access Control Lists (ACLs), see the docs. The Java example code at this URL for the task you mention is pretty simple:
AclEntry entry = new AclEntry();
entry.setScope(new AclScope(AclScope.Type.USER, "jdoe#gmail.com"));
entry.setRole(CalendarAclRole.READ);
URL aclUrl =
new URL("http://www.google.com/calendar/feeds/jo#gmail.com/acl/full");
AclEntry insertedEntry = service.insert(aclUrl, entry);
and what it does is, and I quote:
This code allows jdoe#gmail.com to
have read-only access to
jo#gmail.com's calendar.
There's more where this came from (e.g., upgrading a user's role in an ACL above the read-only access granted in this example), and I think it's a good idea to read the whole page.

Categories