How to report a bug in Office 365 Android SDK - java

I was pointed at Stack Overflow by Microsoft support as the place to get help about the Office 365 Android SDK, including how to report bugs.
I'm finding that a call to Item.getDateTimeLastModified() will consistently return an incorrect date/time. Most of the time, if an item has been recently updated, it will return a millisecond value (in the GMT time zone) that is anything up to 2 hours and a few minutes ahead of current GMT.
Other date times such as Event.getStart()/Event.getEnd() are returning the correct values.
When processing calendar events I am using the following to retrieve events:
ListenableFuture<List<Event>> eventsGet = this.userFetcher
.getCalendar (this.calendarId)
.getEvents ()
.top (pageSize)
.skip (skip)
.select ("Id")
.filter (modFromDate)
.orderBy ("DateTimeLastModified")
.read ();
List<Event> events = eventsGet.get (60,
TimeUnit.SECONDS);
Then I process the events one at a time and using the id get the actual event using:
this.userFetcher.getCalendar (this.calendarId).getEvent (id).read ().get (60, TimeUnit.SECONDS);
Calling getDateTimeLastModified on that event will return the strange value.
I can provide calendar/event ids if required.
As an aside, I notice that the Office.com calendar when it retrieves the json data for the event has the correct last modified time.

You can submit bugs/issues on the Office 365 SDK for Android on the GitHub page where the project is hosted.

I'm Anahí from the Office 365 SDK for Android team.
We've created an issue with your problem in our GitHub repository and will start reviewing it. We'll post the updates there once the error is fixed.
https://github.com/OfficeDev/Office-365-SDK-for-Android/issues/86
The GitHub repo is the best place to submit bugs/issues since we're reviewing it all the time.
Thanks!

Related

Java Telegram Bot: how to send photos having their file_id?

A few years ago I created a bot with telegrambots version 3.6.1.
Unfortunately there was a problem: every time that a user with user_ID>2147483647 joined the group, the bot crashed, as described here.
I've just found out how to update the version of telegrambots, but now I've another problem.
I need to use the setPhoto(String file_id) method as described here in Telegram ot JAVA API page (Pass a file_id as String to send a photo that exists on the Telegram servers).
It looks like that method doesn't accept String parameter anymore since telegrambots version 5.0.0.
Infact it worked until telegrambots version 4.9.2.
So my bot pins a message in the group with a list of many places, each one can have up till 2 photos.
Each of these photos has its file_id saved in a field of a MySql database.
So basically when we use the command to see a pic associated to a place, my code uses setPhoto(file_id) getting the file_id string from the database.
Now it looks like setPhoto(String) doesn't work anymore, so how can I solve this problem? I still need to use all the photo we saved in those years. How can i convert these file_id into InputFile argument?
I've tried to use version 4.9.2 of telegrambots and setPhoto(String) works, but I don't know if in that version, my original problem (numeric value out of range) was already solved and anyway I would like to use the latest version (6.4.0).
I've no idea how to convert String (fileID from database) to InputFile.
Thanks you very much.
The documentation is not really documenting anything, but it looks like the FileInput constructor can take String called attach(ement).

How can sent the date in a datepicker appium (Android API 19, version 1.2.4.1)

I have a problem in setting the date from a date picker in Appium. I'm trying to set the date by sending keys in the fields in this way:
List<WebElement> pick = driver.findElements(By.className("android.widget.EditText"));
pick.get(0).sendKeys("21");
pick.get(1).sendKeys("Mar");
pick.get(2).sendKeys("1989");
This works fine in previous versions of API but since I'm testing in a different device now appium seems not to finding my elements correctly. Here is a photo from the inspector window that shows that I'm using the correct class to find the fields.
Any ideas?Thanks!!
Not sure what's the problem because some information is missing, but maybe try using swipe instead of sendKeys, it doesn't look like a sendKeys field.
Anyway I can recommend a workaround that I'm using when I need to change the date while testing, you can use the following adb command:
adb shell date -s YYYYMMdd.HHmmss
It's much faster and reliable,
hope this helps.
Perform action with xpath
// Select month name in datepicker
driver.findElement(By.xpath("//android.widget.NumberPicker[#index='0']")).sendKeys("Jan");
// Select day in datepicker
driver.findElement(By.xpath("//android.widget.NumberPicker[#index='1']")).sendKeys("24");
// Select year in datepicker
driver.findElement(By.xpath("//android.widget.NumberPicker[#index='2']")).sendKeys("1987");
Perform This way
List<WebElement> textFieldsList = driver.findElements(By.className("android.widget.EditText"));
int size = textFieldsList.size();
textFieldsList.get(0).sendKeys("test");
textFieldsList.get(1).sendKeys("test");
textFieldsList.get(2).sendKeys("test#gmail.com");
I resolved this as shown below in the appium-java client as none of the above worked for me:
Android emulator API level: 28
Android emulator version: 9
Appium java client version: 5.0.4
currentMonthElement in the code below is the WebElement that represents the month field in the datepicker. You can use find by xpath or whichever way you like to find this element using driver.findElement. The below code can be reused to enter value for date and year elements. In the place of currentMonthElement variable, please pass the date and year elements.
touchAction.longPress(LongPressOptions.longPressOptions().withElement(ElementOption.element(currentMonthElement))).release().perform();
driver.getKeyboard().sendKeys(Keys.DELETE);
String monthstr = "Aug";
while(!currentMonthElement.getText().equals(monthstr)){
driver.getKeyboard().sendKeys("Aug");
}
//click on ok button after setting the date, month & year
driver.findElement(By.id("button1")).click();

sugarcrm editview coding help for newbi

I have an older version of sugarcrm 4.5 running.
Dont brake that aint broken.
I have a script i wrote that adds 30 days from current date to expected close date when creating a new opportunity, but the problem is everytime you edit the opportunity it adds 30 days, and not just when its is new. How do i tel Sugar to only look for new. this is in editview.php not a logic hook as i want to display the date in the field when creating.
Heres my code
var currentTime = new Date();
document.getElementsByName('date_closed')[0].value = (year = currentTime.getFullYear())+'-'+(month = currentTime.getMonth() + 2)+'-'+(day = currentTime.getDate());
regards
This should be done with a before save logic hook - you can test to see if the record has an id in the hook. If it has no id then you can assume its a new record.
More information on logic hooks can be found here (you are using a very old version of SugarCRM so not everything in this documentation will apply)
http://developers.sugarcrm.com/docs/OS/5.2/-docs-Developer_Guides-Developer_Guide_5.2-DevGuide%205.2.1.47.html

All Event listing on specified date in Google Calender api (V3) in java?

what I want to do is get all the events in a given google calendar for a given date.
Now we can get the event listing pretty easily using the following code
public Events getAllEvent()
{
Events events= null ;
try {
events = service.events().list(this.calendarID).execute();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return events ;
}
How should I convert this function so that it will give only event on that day which i specify. I tried a lot of way but in version 3 it's not working the way it use to in v2.
Any suggestion. Please Remeber that we are talking about google calender Api version 3.
Hi ya i found the answer to my ques so updating here for others.
This can be done. Though we do not have direct way we can do it using query parameter. Let say if we wanted events feed from today onwards and not earlier than today. Then we can do this.
Events events = service.events().list(calendarID).setTimeMin("2012-01-01T00:00:00Z").execute();
instead of
events = service.events().list(this.calendarID).execute();
which just give us all the feeds from way back till 2031.
For getting feeds in between dates use setTimemin and setTimeMax together
Hope this help someone cheers...
Listed below is the code to use the Calendar service for v3 of the Google API utilizing Oauth2. I am posting it, since it is documented incorrectly by Google on their site.
Calendar service3 = new Calendar(transport, jsonFactory, accessProtectedResource);
com.google.api.services.calendar.model.Calendar calendar = service3.calendars().get("primary").execute();
com.google.api.services.calendar.model.Events events = service3.events().list("primary").execute();
Sameer currently the API doesn't includes this feature. But you can make a feature request here Apps Apis issue tracker.
You shall get some positive reply soon as it is monitored by Google engineers themselves.

Google Calendar API w/ Java - Get events only for the default calendar, ignoring the holidays

What I am trying to do is get a list of all the events in the default calendar only? I don't want any other calendars' events included, i.e., holidays.
I am using the ".../feeds/username/default/full" and doing a query for all events from 1 month ago to forever. I have two events that I have created but I get a feed with 25 entries. My two events first and then 23 holidays. I really don't them to be included at all but if them MUST be there, how do I detect them. The only thing I can find is the eTag for my two events is different from the holiday ones. But I can't just say get all the events from the first Etag I encounter because the default calendar may not have any events so the first one would be holidays.
Any help would be appreciated.
This can be done with a few lines of code using the latest version of the Google Calendar API. All you need to do is pull the events for the primary calendar, as documented here:
http://code.google.com/apis/calendar/v3/using.html#retrieving_events
The code you need is:
Events events = service.events().list("primary").execute();
while (true) {
for (Event event : events.getItems()) {
System.out.println(event.getSummary());
}
String pageToken = events.getNextPageToken();
if (pageToken != null && !pageToken.isEmpty()) {
events = service.events().list("primary").setPageToken(pageToken).execute();
} else {
break;
}
}
I wonder what version of the Calendar API you are using? In v3 I am able to all my events without getting the holidays. I added some more code examples, since the Google documentation is incorrect for connecting to the Calendar V3 API though Oauth2 for Java.
Use the code listed in the other post to loop though the Calendar events after the Oauth is setup and the Calendar is initialized. You probably can, but do not need to declare the events API. I just call it from the Calendar service(3). Note the Calendar ID I have listed is "Primary."
Calendar service3 = new Calendar(transport, jsonFactory, accessProtectedResource);
com.google.api.services.calendar.model.Calendar calendar = service3.calendars().get("primary").execute();
com.google.api.services.calendar.model.Events events = service3.events().list("primary").execute();

Categories

Resources