Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4025874
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:54:03+00:00 2026-05-20T10:54:03+00:00

Hello m I am new to android.. I have samsung galaxy 3 and android

  • 0

Hello m
I am new to android..
I have samsung galaxy 3 and android 2.1 installed in it..
I want to build an widget as follows..

1.I want to access calendar of phone.. (googled a lot found diffrent answers but none wokrin..) (jimblackler.net/blog/?p=151 not working)..
since no public api is available it will be ok even if am able to use google calendar(the one from web).. letme know whichever is easier to implement. I just want to read events..

2.How do I trigger events on a specific time.. say when it is 3:00hrs it should call a function..
Is it possible ? if so how

3.I want to send two strings to a server and recieve andother text back as result. which would be the easiest way to code ?? have an c# web service..? or just use a php script on server accepting few parameters?

thanks a lot. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:54:03+00:00Added an answer on May 20, 2026 at 10:54 am

    First Question: Calendar access: This is based on the content://calendar/calendars URI.
    First, make sure your application defines the permission android.permission.READ_CALENDAR.

    Get the calendars IDs and display names:

    ContentResolver myContentResolver = getContentResolver();
    
    final Cursor cursor = myContentResolver.query(Uri.parse("content://calendar/calendars"),
            (new String[] { "_id", "displayName", "selected" }), null, null, null);
    
    while (cursor.moveToNext()) {
    
        final String _id = cursor.getString(0);
        final String displayName = cursor.getString(1);
        final Boolean selected = !cursor.getString(2).equals("0");
    }
    

    Work on a specific calendar:

    Uri.Builder myUriBuilder = Uri.parse("content://calendar/instances/when").buildUpon();
    long currentTime = new Date().getTime();
    ContentUris.appendId(myUriBuilder , currentTime  - DateUtils.WEEK_IN_MILLIS);
    ContentUris.appendId(myUriBuilder, currentTime + DateUtils.WEEK_IN_MILLIS);
    
    Cursor eventCursor = myContentResolver.query(myUriBuilder.build(),
            new String[] { "title", "begin", "end", "allDay"}, "Calendars._id=" + id,
            null, "startDay ASC, startMinute ASC");
    
    while (eventCursor.moveToNext()) {
        // fields:
        // Event title - String - 0
        String eventTitle = eventCursor.getString(0);
        // Event start time - long - 1
        Date startTime = new Date(eventCursor.getLong(1));
        // Event end time - login - 2
        Date endTime = new Date(eventCursor.getLong(2));
        // Is it an All Day Event - String - 3 (0 is false, 1 is true)
        Boolean allDay = !eventCursor.getString(3).equals("0");
    
    }
    

    Second Question: Scheduling Events:
    Basically, you should use the AlarmManager class, see the android SDK for details.
    Example to set the event 3 hours from now:

     Calendar cal = Calendar.getInstance();
     cal.add(Calendar.HOUR, 3);
     Intent intent = new Intent(this, MyAlarmHandler.class);
     intent.putExtra("alarm_message", "Wake up!");
     int requestCode = 3824723; // this is not currently used by Android.
     PendingIntent pIntent = PendingIntent.getBroadcast(this, requestCode, intent, PendingIntent.FLAG_UPDATE_CURRENT);
     AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
     alarmManager.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pIntent);
    

    Third Question: Yes, I suggest the PHP approach

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to Android, I've followed the hello world tutorial through and have a
Hello I am new to Android .I have been given an Android project to
Hello i am new to android development I have never seen this type of
I have created a webservice and I want to use a android phone as
I am new to android widget.I did sample application , that want to show
Hello i am new in android and i really need help with something. I
Hello StackOverflow Users, I am new to android and trying to develop a game
hello im new to python and have been reading over the documentation and am
Hello.Am new to ios development.What have to do for NSOpenPanel to work in the
Hello I am new to the Objective C and I have a problem. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.