Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 7    Views: 94

FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
01/20/16 05:36 AM (8 years ago)

Open Calendar

Hi guys, need help from the gurus again lol, I need to know how to put a open device calendar, ie you press the button, then the devices calendar would open and the user can add a date and time, there is plugin for that but its only ios, i need it for both, all i need is a button on a screen that opens the devices calendar, no presets or anything. cheers guys Sean
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
01/20/16 10:54 AM (8 years ago)
http://developer.android.com/guide/components/intents-common.html#Calendar that link has examples to open alot of built in apps on android devices.You can just take off the put extras and make the button call this function when pressed public void addEvent(String title, String location, Calendar begin, Calendar end) { Intent intent = new Intent(Intent.ACTION_INSERT) .setData(Events.CONTENT_URI) .putExtra(Events.TITLE, title) .putExtra(Events.EVENT_LOCATION, location) .putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, begin) .putExtra(CalendarContract.EXTRA_EVENT_END_TIME, end); if (intent.resolveActivity(getPackageManager()) != null) { startActivity(intent); } }
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
01/20/16 11:00 AM (8 years ago)
Thanks Coffee, but im looking for a solution for both platforms,ie not having to build 2 separate app,its only for extra funtion a client wants in there app, any idea? cheers Sean
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
01/20/16 11:29 AM (8 years ago)
yea you could just add the button and code to the android version of that plugin when you download the project for android.You'll get an error in android studio because the layout files not there but just copy from the layout from the blank plugin into the xml file of that plugin. then got to the visual part of the xml file and drag a button on there. note the id of the plugin. then in the java file. add the button code whats the ios plugin that does this? not sure if I have it or not. but pretty easy to make
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/20/16 03:39 PM (8 years ago)
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
01/21/16 01:03 AM (8 years ago)
Thanks guys, how do i put this into a button in ios though, im clueless when it comes to coding, heres the ios plugin https://www.buzztouch.com/plugins/plugin.php?pid=8BC0423A050CD06E5C492D0 cheers sean
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
01/21/16 10:48 AM (8 years ago)
Easy but it's probably better to watch a youtube video than for me to post. I'll post some code later when I get time though. Basically just drag a ui button on the xib file. Then declare a property and ibaction in the header file. Next connect button to both of those. Then add the code in the ibaction function in the implementation file of that plugin
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
01/22/16 02:40 AM (8 years ago)
can i do this with both cofee/ ie use the calender plugin on iou , then the buttons function in Android, thanks sean
 

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.