Q:

How do I parse custom url into a calendar event?

what I am trying to do is, with this custom url of mine 
(mlevents://add/event?day=8&month=10&year=2014&timestring=12:00 PM - 12:30 PM &hourS=12&minuteS=00&hourE=12&minuteE=30&title=Filene 101: Think. Do. Change. | Webinar&timezone=CST)

be able to parse and save as a calendar event that will store to Google Calendar, I have had no luck with it and I have mlevents set up as a custom scheme in my manifest.xml but still no luck. How would I go about setting this up so it works correctly?

A:

You need to use the String.split method which takes a regex pattern, depending on what you want you need to change the pattern - but to split the string on "&" then for each string in array use "=" you do do this: This is a full code : tru
public class Event {
String[] myStringArr;

int day;
int month;
int year;
String timeString;
int hourS;
int minuteS;
int hourE;
int minuteE;
String title;
String timezone;

public int getDay() {
    return Integer.parseInt(myStringArr[0].split("=")[1]);
}

public int getMonth() {
    return Integer.parseInt(myStringArr[1].split("=")[1]);
}

public int getYear() {
    return Integer.parseInt(myStringArr[2].split("=")[1]);
}

public String getTimeString() {
    return myStringArr[3].split("=")[1];
}

public int getHourS() {
    return Integer.parseInt(myStringArr[4].split("=")[1]);
}

public int getMinuteS() {
    return Integer.parseInt(myStringArr[5].split("=")[1]);
}

public int getHourE() {
    return Integer.parseInt(myStringArr[6].split("=")[1]);
}

public int getMinuteE() {
    return Integer.parseInt(myStringArr[7].split("=")[1]);
}

public String getTitle() {
    return myStringArr[8].split("=")[1];
}

public String getTimezone() {
    return myStringArr[9].split("=")[1];
}

public Event(String[] myStringArr) {
    super();
    this.myStringArr = myStringArr;
}

}
in your activity :
    String customUrl = "(mlevents://add/event?day=8&month=10&year=2014&timestring=12:00 PM - 12:30 PM &hourS=12&minuteS=00&hourE=12&minuteE=30&title=Filene 101: Think. Do. Change. | Webinar&timezone=CST)";
    final String[] myStringArr = customUrl.split("&");
    Event event = new Event(myStringArr);   

    System.out.println(event.getDay()); // -> return 8 : the day 
    System.out.println(event.getTitle()); // return Filene 101: Think. Do. Change. | Webinar 

   // etc.. your variable event contains all data from your url , 
  // to get an info just call : event.getWhatYouWant();

