Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 21    Views: 151

Worker73
Android Fan
Profile
Posts: 419
Reg: Feb 06, 2012
Austria, Klagen...
4,490
04/28/16 11:42 AM (8 years ago)

Problem wit chris1' s Calender Events PlugIn

Hi All, i hope someone can help me... Im bought chris1's Plugin and tryed to use it on Android. - Google Calender Api is ON - Serverkey is Okay - Calender is Public - Plugin Loads the Event but: - The Date is Wrong in Front of the Event (Always Show:"Jan 1") - When i touch the Event, the App crahses My "System": Android Studio 2.0 Self Hosted
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
04/28/16 08:17 PM (8 years ago)
G'day @Worker73, I had the exact same problem here: http://www.buzztouch.com/forum/thread.php?tid=3697468B02AEFE0BECD255E&currentPage=1 I posted to the forum and sent Chris a private message but haven't heard. Perhaps someone who has his email can reach out to him? I found the issue only effected "All Day" events. Any events with start and end times worked ok. Also, it does the same on iOS (but doesn't crash the app). So I believe the issue is with the getEvents.php file. The json for an event that does work looks like this: {"itemId":"m2ri6kjnnymnyymn78qla0", "htmlLink":"https://www.google.com/calendar/event?eid=blslssliouioawuoiaw0", "descriptionText":"","titleText":"My great event", "creatorEmail":"[email protected]", "creatorName":"", "startDate":"2016-05-03T08:00:00+10:00", "endDate":"2016-05-03T08:30:00+10:00", "day":"3", "month":"05", "location":""}, Json for events that don't work are missing the "startDate" and "endDate" values. Furthermore the "day" and "month" values are extracted from these start and end dates. $month = date("m",$startTime); $day = date("j",$startTime); I've played with the getEvents.php (commenting out functions and trying different stuff) but haven't had any luck yet. Cheers Darrel
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
04/28/16 09:54 PM (8 years ago)
UPDATE: It turns out that Google's API has a "Date" field for all day events and a "DateTime" field for other timed events. I can get the json working right now by making these changes to the php file in the plugins folder /files/plugins/CR_eventList/files/getEvents.php. In your getEvents.php file on your server (make a copy first) replace this ... $start = $thisEvent->getStart(); $startDateTime = $start->dateTime; $end = $thisEvent->getEnd(); $endDateTime = $end->dateTime; With this ... $start = $thisEvent->getStart(); if (($start->getDate())!= NULL) { $startDateTime = ($startDateTime = $start->date); } else { $startDateTime = ($startDateTime = $start->dateTime); } $end = $thisEvent->getEnd(); if (($end->getDate())!= NULL) { $endDateTime = ($endDateTime = $end->date); } else { $endDateTime = ($endDateTime = $end->dateTime); } This outputs the correct json so at least the calendar 'looks' right i.e. correct displaying month and day!!! However, when you tap the event on iOS it still comes up as Jan 1. I believe to fix this will require some code changes in xcode and Android studio. In xcode it looks like this ... [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"]; So when you pass it a json variable that doesn't have the hours and minutes it just chokes :( Will keep you posted, hopefully someone else will jump in with some further updates. Cheers Darrel
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/29/16 12:26 AM (8 years ago)
I don't have this plugin, so I'm not going to be able to assist much... but if you feel comfortable playing with the java code, you can try using some of the methods discussed here: http://viralpatel.net/blogs/check-string-is-valid-date-java/ basically it checks to see the format of the supplied string, and intercept and change it to whatever is needed before it bombs on you... Just a thought. Cheers! -- Smug
 
Worker73
Android Fan
Profile
Posts: 419
Reg: Feb 06, 2012
Austria, Klagen...
4,490
like
04/29/16 12:59 AM (8 years ago)
One Question.... Where is Chris1? ;-) I bought it, and it doesnt work... ;-(
 
Worker73
Android Fan
Profile
Posts: 419
Reg: Feb 06, 2012
Austria, Klagen...
4,490
like
04/29/16 03:13 AM (8 years ago)
@ictguy: Thanks for the Code.... The Date Display works now, but on touching it the App Crashes... ;-(
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
04/29/16 03:16 AM (8 years ago)
When I get a chance I'll look at the code ... I need a fix too :) I think we need another conditional "If statement" for the Date and DateTime in the actual java and objective c files.
 
Worker73
Android Fan
Profile
Posts: 419
Reg: Feb 06, 2012
Austria, Klagen...
4,490
like
04/29/16 03:17 AM (8 years ago)
Okay... That effects "only" when you have Events with "whole Day".. When i change the Event to: From > To (Clocktime) than it works... But maybe there is a Hack for that also? And there are Problems with Displaying special character's like: "Ä""Ü""Ö" and so on ...
 
Worker73
Android Fan
Profile
Posts: 419
Reg: Feb 06, 2012
Austria, Klagen...
4,490
like
04/29/16 03:18 AM (8 years ago)
That would be great ictguy.... Can i spend you an "Löwenbräu" from Austria to Australia? ;-)
 
Worker73
Android Fan
Profile
Posts: 419
Reg: Feb 06, 2012
Austria, Klagen...
4,490
like
04/29/16 03:20 AM (8 years ago)
And Maybe there is an Chance to get the "Titel" and not the "Discription" to show on the first Page?
 
Worker73
Android Fan
Profile
Posts: 419
Reg: Feb 06, 2012
Austria, Klagen...
4,490
like
04/29/16 03:58 AM (8 years ago)
YAY! Work'd out the "Problem" with the "Special Charakters"... Just Delete in the "getEvents.php".. Line 78 & Line 80 the UTF-8 Stuff ;-)) $data = utf8_encode($data); <-- DELETE $data = iconv('UTF-8', 'UTF-8//IGNORE', $data); <-- DELETE WORKS! ;-)
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
04/29/16 04:00 AM (8 years ago)
Good stuff with the special characters! I'll admit I had to look it up (Löwenbräu) but beer is always good :))))
 
Worker73
Android Fan
Profile
Posts: 419
Reg: Feb 06, 2012
Austria, Klagen...
4,490
like
04/29/16 05:17 AM (8 years ago)
Another little "hack".... To Chance the Listcolour... Just write in the "JSON Configuration Data (Editable)" "listDescriptionFontColor": "#000000", #000000 = Your Color.... Attention.. When you Change something in the PlugIn Original Setup you must Enter the Line of Code again... But it Works ;-)
 
Worker73
Android Fan
Profile
Posts: 419
Reg: Feb 06, 2012
Austria, Klagen...
4,490
like
04/29/16 05:36 AM (8 years ago)
Okay... found the "Problem"... When the "Event Description" is to long, the "Event-Title" is not Shown... ;-( Okay.... I Figured out the "Titel" Thing... To Show (In the Listview) Only the Titel whitout the Description just change the Line 534 in CR_eventList.java from: String descriptionText = BT_strings.getJsonPropertyValue(tmpItem.getJsonObject(), "descriptionText", ""); TO String descriptionText = BT_strings.getJsonPropertyValue(tmpItem.getJsonObject(), "", ""); Now Only the Event Title is Shown and when you "Tab" on the Event it shows all the Informations included the Description... Now only One Problem left... When a Event has NO Time (Whole Day) and goes on many Days... Thanks..
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
04/29/16 05:13 PM (8 years ago)
Hey guys - sorry to be MIA on this plugin. Sounds like you guys have made some good progress in terms of resolving the bugs. Can someone send me a project with the plugin in it hooked up to data known to cause a problem and I'll take a look? Send me a dropbox link via Buzztouch messages if you don't already have my email.
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
04/29/16 11:36 PM (8 years ago)
@chris1 can you private message me your email and I'll send my current project. I'm not having problems with the title/description (not yet at least), just the whole day events which we partially solved. Cheers Darrel
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
04/29/16 11:38 PM (8 years ago)
@worker73 BTW you can change all of the list colors and properties by just adding the json manually to the screen's json(right at the bottom of your screen in the control panel). Just add ... "listTitleFontColor": "#yourhexcolor", "listDescriptionFontColor": "#yourhexcolor", "listRowSeparatorColor": "#yourhexcolor"
 
Worker73
Android Fan
Profile
Posts: 419
Reg: Feb 06, 2012
Austria, Klagen...
4,490
like
04/30/16 03:55 AM (8 years ago)
@ictguy.. Thanks, Seen it already... There is also another Way to Change the Colors and Fontsize permanantly... Just in the Projekt java File: "CR_eventList.java"... Maybe chris1 have time to make that changes also for the Controlpanel. That whould be great!
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/01/16 04:31 PM (8 years ago)
Hey guys - I pulled out the old plugin to take a look at it and there's a problem with updating it with the bug fixes you identified. This plugin was in the old plugin format that used PHP where David Book had to review every single submission. As a result, I can't just apply your suggestions and resubmit as the current system does not allow PHP at all. And because the main script to get the events is PHP based (getEvents.php), it's no small task to make an update work. I'm open to suggestions, but the best thing may be to take it off the market.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/01/16 09:35 PM (8 years ago)
Nevermind - turns out I had an old version on my computer. Thanks to ictguy I fixed the crashing issue and thanks to Worker73 I added some additional properties. I haven't looked at the non-Latin character issue yet, but I'm guessing it is related to the php script. If anyone comes up with a solution let me know. Version updated to 1.3. Chris
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
05/02/16 05:05 AM (8 years ago)
Thanks - appreciate your support. I'll download it and have a go with the new code. Cheers Darrel
 
Worker73
Android Fan
Profile
Posts: 419
Reg: Feb 06, 2012
Austria, Klagen...
4,490
like
05/03/16 03:50 AM (8 years ago)
I checkd the "new" php files (After Update to 1.3).... Same problem with "Special Chars".... Deleted the two Lines 78 & 80.. now it works also with Special Chars.... Thanks for the Color Properties... Can you also add the Font Size for "Titel" and Description Please? Cheers Worker73
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.