[android-developers] Beacon subscribe return status code: SUCCESS, but nothing recevied

2017-02-17 Thread KC Chan
I followed the instruction 
on https://developers.google.com/nearby/messages/android/get-started
All the thing seems fine. I called the subscribe function and it return 
status {statusCode=SUCCESS, resolution=null}
And we have a Beacon device using the same Google Project and board-cast 
the Eddystone-UID with attachment.
We checked the device with Beacon Tools and it works fine.
I don't see any problem, but the result is that the client have not receive 
any message, whatever the app is in foreground or background.

Any Advise?


-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/2f8e8bd8-2771-4cbe-a115-085ddd9d1bee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Google maps in Webview

2016-01-29 Thread William Chan
Hi there! I just built an app with a webview to display my responsive 
website, but some of the Google maps in the webview are not showing up. Is 
there something I should be importing or including? Thank

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/e186e668-b537-44a0-8111-d5e06ac6bed7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Emulator 4.0.3 calendar create event not shown

2013-01-02 Thread Michael Chan
Hi,

The month is base 0 i.e. December = 11. Try fixing that first.

Another thing to check is to make sure that the calendar is being displayed
- check the calendar in Calendar - Menu - Calendars to display. If the
calendar is not visible, go to Calendar - Menu - Calendars to sync and
check the calendar you want.

Note that ActiveSync support (which is needed when syncing via the
Email/Exchange route) has been ended for *new* users unless you are paid
Google Apps users or Google Apps for Business, Education, and Government
customers. If you haven't sync this before Dec 14, 2012, events may not
sync. See http://support.google.com/a/bin/answer.py?hl=enanswer=2716936 for
details.

Thanks,
Mike

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] How to get events of a specific calendar from android 2.3

2012-11-19 Thread Michael Chan
Hi,

You can do that by adding a selection/selectionArgs pair that matches
CalendarContract.Events.CALENDAR_ID with the calendar id of the
specific calendar.

Search for selectionArgs in
http://developer.android.com/guide/topics/providers/calendar-provider.html
for examples.

Thanks,
Mike

On Mon, Nov 19, 2012 at 2:04 AM, Dawood Abbasi dawoodahma...@gmail.com wrote:
 i want to get events details of a specific calendar (not all calendars) from
 android 2.3
 how can i do this???

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Is there a convention for the columns CalendarContract.EventsColumns.SYNC_DATA1 - SYNCDATA10?

2012-11-15 Thread Michael Chan
 I'm calling as a sync adapter.

Are you writing a sync adapter? If not, you shouldn't be doing that.
The GoogleCalendarSyncAdapter can change the meaning of the sync_data
columns at anytime so you can't rely on it. If you modify the events,
the dirty bit won't be set and the real syncadapter own't notice the
change.

And if you are, you shouldn't be syncing the calendar for
account_type=com.google.

 Is it possible that GoogleCalendarSyncAdapter does the update and sets the 
 DIRTY flag back to zero before it reaches my sync adapter?

Yes, that's how it works.

On Thu, Nov 15, 2012 at 9:38 AM, Christopher Masser cmas...@gmail.com wrote:
 hm, the DIRTY flag is always zero for me and I'm calling as a sync adapter.
 Is it possible that GoogleCalendarSyncAdapter does the update and sets the
 DIRTY flag back to zero before it reaches my sync adapter?


 On Monday, November 12, 2012 2:57:43 PM UTC+1, Christopher Masser wrote:

 CalendarContract.EventsColumns.SYNC_DATA1 - SYNCDATA10 are said to be
 columns of the content provider for use with sync adapters. Does anybody
 know if there is some convention for what is the use of these columns? I've
 realized that on my device SYNC_DATA5 stores the date last modified and
 SYNC_DATA1 seems to store the Google event ID. So it seems whenever the
 Calendar app syncs with Google Calendar, these columns are modified.

 However, if I choose to use one of these columns for my sync adapter, how
 can I make sure another application doesn't use the very same columns and
 they override each other?

 If SYNC_DATA5 is ALWAYS used by Google Calendar to store the date last
 modified I would be fine with just using that for my sync logic, I just need
 to be certain that this is a convention.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Androin 2.2 calendar source code

2012-11-14 Thread Michael Chan
Hi,

Not sure if you are looking for UI or data.

There's no platform UI for the calendar like in MapView. You will have to
build that yourself or use someone else's.

For calendar data, have a look at
http://developer.android.com/guide/topics/providers/calendar-provider.html

Thanks,
Mike


On Mon, Nov 12, 2012 at 5:28 AM, chetana dpatilchet...@gmail.com wrote:

 Hello sir,
 I am creating an android app of calendar *events.Is* http://events.is/it 
 possible to get calendar directly linked to my app?
 My app should include simple calendar with month,weeks and days.Below
 calendar, events in that particular month must be displayed.when a date is
 selected, events for that day must appear in detail.I am having doubt in
 providing user input.,as i am developing this app as an assignment for my
 institution,me as a developer will provide info about all events taking
 place in the institution in that particular semister,and the app is updated
 in times for new revised calendar.
 How can i get my app linked to the calendar?
  As i am a beginner,i have less idea about it...It would be great help if
 you could please help me out with any related source code or suggestions.
 Thank you
 regards,
 Chetana P

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Is there a convention for the columns CalendarContract.EventsColumns.SYNC_DATA1 - SYNCDATA10?

2012-11-14 Thread Michael Chan
Hi,

The SYNC_DATA* columns are reserved for the sync adapters to use.The
GoogleCalendarSyncAdapter can use it for any purpose and change the
usage whenever it wants. There's no standard convention.  If you are
using a sync adapter, use it in any way to fit your needs.

 how can I make sure another application doesn't use the very same columns and 
 they override each other?

There's no sure way. The CalendarProvider allows access to the
SYNC_DATA* columns only if the caller identifies itself as a sync
adapter. And in that case, they can only access rows that matches the
supplied ACCOUNT_NAME and an ACCOUNT_TYPE. This is to prevent
accidental access. It doesn't validate whether the caller is a sync
adapter or not.
http://developer.android.com/guide/topics/providers/calendar-provider.html#sync-adapter

Thanks,
Mike

On Mon, Nov 12, 2012 at 5:57 AM, Christopher Masser cmas...@gmail.com wrote:
 CalendarContract.EventsColumns.SYNC_DATA1 - SYNCDATA10 are said to be
 columns of the content provider for use with sync adapters. Does anybody
 know if there is some convention for what is the use of these columns? I've
 realized that on my device SYNC_DATA5 stores the date last modified and
 SYNC_DATA1 seems to store the Google event ID. So it seems whenever the
 Calendar app syncs with Google Calendar, these columns are modified.

 However, if I choose to use one of these columns for my sync adapter, how
 can I make sure another application doesn't use the very same columns and
 they override each other?

 If SYNC_DATA5 is ALWAYS used by Google Calendar to store the date last
 modified I would be fine with just using that for my sync logic, I just need
 to be certain that this is a convention.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Is there a convention for the columns CalendarContract.EventsColumns.SYNC_DATA1 - SYNCDATA10?

2012-11-14 Thread Michael Chan
Hi,

 If you are using a sync adapter, use it in any way to fit your needs.

This should have read: If you are WRITING a sync adapter, you can use
those columns in any way to fit your needs.


The dirty column tells the sync adapter that the row has changed.
Sorry, there's no way for non-sync adapters to know what has changed.

Thanks,
Mike




On Wed, Nov 14, 2012 at 12:28 PM, Christopher Masser cmas...@gmail.com wrote:
 Great, thanks for your clarification!
 I'm then also wondering how my sync adapter can know if a row was updated in
 the calendar provider?
 Upon a change in the calendar, my sync adapter gets called by the calendar
 provider.
 However, at the time onPerformSync(...) gets called all the rows in the
 calendar provider are set to DIRTY = 0
 (this could be because Google sync set it to zero or other applications set
 it to zero).

 So how can I find out if a row was recently inserted or updated, especially
 since there is no DATE_LAST_UPDATED column in the calendar provider?
 Am I missing something?

 Best regards,
 Christopher

 On Wednesday, November 14, 2012 6:58:02 PM UTC+1, Michael Chan wrote:

 Hi,

 The SYNC_DATA* columns are reserved for the sync adapters to use.The
 GoogleCalendarSyncAdapter can use it for any purpose and change the
 usage whenever it wants. There's no standard convention.  If you are
 using a sync adapter, use it in any way to fit your needs.

  how can I make sure another application doesn't use the very same
  columns and they override each other?

 There's no sure way. The CalendarProvider allows access to the
 SYNC_DATA* columns only if the caller identifies itself as a sync
 adapter. And in that case, they can only access rows that matches the
 supplied ACCOUNT_NAME and an ACCOUNT_TYPE. This is to prevent
 accidental access. It doesn't validate whether the caller is a sync
 adapter or not.

 http://developer.android.com/guide/topics/providers/calendar-provider.html#sync-adapter

 Thanks,
 Mike

 On Mon, Nov 12, 2012 at 5:57 AM, Christopher Masser cma...@gmail.com
 wrote:
  CalendarContract.EventsColumns.SYNC_DATA1 - SYNCDATA10 are said to be
  columns of the content provider for use with sync adapters. Does anybody
  know if there is some convention for what is the use of these columns?
  I've
  realized that on my device SYNC_DATA5 stores the date last modified and
  SYNC_DATA1 seems to store the Google event ID. So it seems whenever the
  Calendar app syncs with Google Calendar, these columns are modified.
 
  However, if I choose to use one of these columns for my sync adapter,
  how
  can I make sure another application doesn't use the very same columns
  and
  they override each other?
 
  If SYNC_DATA5 is ALWAYS used by Google Calendar to store the date last
  modified I would be fine with just using that for my sync logic, I just
  need
  to be certain that this is a convention.
 

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Empty EditText when turning screen on and Screen lock set to 'None'

2012-10-30 Thread Michael Chan
Do you have an android:id set for the EditText?
See 
http://developer.android.com/reference/android/view/View.html#attr_android:saveEnabled

On Tue, Oct 30, 2012 at 3:36 PM, pushbit push...@gmail.com wrote:
 I'm having a problem where an EditText in landscape/full screen mode becomes
 empty after turning the screen off and then on when the system Screen lock
 is set to 'None'.  The keyboard remains active, but it doesn't appear to
 have focus and no text updates are displayed on the screen.  If I press
 'Done' or rotate to portrait, then the full screen editor is removed and I
 can see the previously entered text in the normal EditText view.  I'm
 reproducing this on JB on both the emulator and a device.

 I found the same problem in Calendar, but not in Messaging.  When editing an
 SMS message in landscape/full screen mode and then turning the screen
 off/on, at first the message appears to be empty, but then it returns after
 a second.  I reviewed the source code below, but I didn't see anything
 special in onResume() that looked to be addressing this issue.

 https://github.com/android/platform_packages_apps_mms/blob/master/src/com/android/mms/ui/ComposeMessageActivity.java

 Does anyone know how to properly fix this, so that when Screen lock is
 'None' you can edit text in landscape/full screen mode, turn the screen off
 and then back on, and the text is displayed just as you left it?

 Thanks,
 pb
 
 Open Source Android App
 Dining Out (with friends)

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Inserting past event in local android calendar in Froyo

2012-10-23 Thread Michael Chan
Hi,

The Instances table is lazily populated. You don't see them if you are
looking via sqlite3. If you do a query via the ContentProvider
interface, you should see the instances for the events.

Thanks,
Mike


On Sat, Oct 20, 2012 at 12:54 AM, Bharat Parikh bharatpa...@gmail.com wrote:
 Objective: To write a sync adapter that syncs Google calendar events with
 local android calendar (server to device - one way only).

 Android Version: Froyo

 Debugging Steps:

 A past non-recurring event (one month old) is read from Google Calendar
 I insert it locally in android calendar (calendar entry that I created)
 The event is inserted successfully in events table but the corresponding
 entry in instances table is not created
 I update the calendarmetadata table values to mininstance=0 and
 maxinstance=event's end date in millis (on command prompt through sqlite3
 tool)
 I again try inserting the same event locally
 This time the event is inserted successfully in events table and the
 corresponding entry in instances table also gets created

 Looking at the CalendarProvider.java and Calendar.java source code and
 further probing revealed the following:

 After I insert a row in Calendars table, the mininstance is set to today's
 date and maxinstance is set to some 7 or 15 days in future so e.g. if today
 is 19-Oct, creating a calendar entry and accessing the calendar agenda
 activity sets mininstance=19-Oct (in millis) and maxinstance=26-Oct (in
 millis).
 In step # 3 above when the content provider inserts an event it looks at the
 mininstance and maxinstance values to expand and insert instances for the
 given event in instances table. Since the event start time lies before the
 mininstance value (since the event is one month old) the content provider
 doesn't create corresponding instances entry.

 Given that I cannot directly write to calendarmetadata and instances tables
 from my code how can I sync older events with my local calendar on android
 device for froyo version?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] After Free Trial is end

2012-10-17 Thread Michael Chan
Hi Julia,

From 
http://developer.android.com/guide/google/play/billing/billing_subscriptions.html

As with other in-app products, you configure and publish subscriptions
using the Developer Console and then sell them from inside apps
installed on an Android-powered devices. In the Developer console, you
create subscription products and add them to a product list, then set
a price and optional trial period for each, choose a billing interval
(monthly or annual), and then publish.

Thanks,
Mike


On Wed, Oct 17, 2012 at 8:52 AM, Julia Uschapovska
uschapov...@gmail.com wrote:
 Does a user pay only once when the trial period is over? or is there some
 monthly/yearly or any other subscription type?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Using NFC on Android

2012-10-04 Thread William Chan
Hi

I'm working on a project for Uni and I was wondering which is the lowest 
level of the Android API I would need to use for accessing NFC functions 
etc.

Thank you very much.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Using NFC on Android

2012-10-04 Thread William Chan
Thank you very much everyone who has replied. I am grateful for your time 
spent answering.
I'm not sure how I can reply to everyone so I'm going to do so here.

It looks like 9 is the base API for NFC. I think I will develop the app in 
API 10 as it probably has the basics of NFC tried and tested. So I shall 
develop on that.

Thank you very much again,
William Chan

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Google Calendar API

2012-08-16 Thread Michael Chan
Have you seen
http://developer.android.com/guide/topics/providers/calendar-provider.html?


On Tue, Aug 14, 2012 at 1:20 PM, Kennet kennetsund...@gmail.com wrote:

 Hi

 I am new to android.

 I am trying to develop an app that uses google calendar but I am having a
 hard time understanding the API
 would it be possible for any of you to describe how you make your app
 interact with google calendar?

 -what should I write in my .java file?
 -what should I write in my manifest?
 -other stuff that needs to be done to make this work?

 Kind regards
 Kennet

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Android: Add entry to the calendar

2012-08-08 Thread Michael Chan
Hi,

Have a look at 
http://developer.android.com/guide/topics/providers/calendar-provider.html

Thanks,
Mike

On Wed, Aug 8, 2012 at 2:40 AM, Rahul Kaushik rahulkaushi...@gmail.com wrote:
 Hi,

 I need to add an entry in android calendar
 please suggest.

 Thanks
 RK

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Make My CustomCamera App appear on the Select files to upload Dialog when click on input type='file' control on a webpage

2012-07-31 Thread Benny Chan
Hi,

As mentioned in the subject line, can you please advice how I can achieve 
that?

Thank you.

Regards,

Benny

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Why Android will always delete the calendar?

2012-07-10 Thread Michael Chan
Hi,

The provider deleted the calendar because it is not associated with an
account/type. As you have discovered, we added the
CalendarContract.ACCOUNT_TYPE_LOCAL for your use case. Unfortunately,
it was introduced in API 15 when we opened up the calendar api.

Thanks,
Mike

On Sat, Jul 7, 2012 at 11:28 AM, Roland Schumacher b...@geniali.ch wrote:
 I create a new calender with this code. Android 2.3.5

 if(Build.VERSION.SDK_INT  14)
 {
 ContentValues calendar = new ContentValues();

 calendar.put(_sync_account, Com2Cal);
 calendar.put(_sync_account_type, LOCAL);
 calendar.put(name, Com2Cal);
 calendar.put(displayName, Com2Cal);
 calendar.put(color, 0xFF008080);
 calendar.put(access_level, 700);
 calendar.put(sync_events, 1);
 calendar.put(timezone, TimeZone.getDefault().getID());
 calendar.put(ownerAccount, Com2Cal);
 calendar.put(hidden, 0);
 Uri conentUri;

 if(Build.VERSION.SDK_INT = 8)
 {
 conentUri =
 Uri.parse(content://com.android.calendar/calendars);
 }
 else
 {
 conentUri = Uri.parse(content://calendar/calendars);
 }

 Uri newRow =
 context.getContentResolver().insert(createCompleteUri(conentUri), calendar);

 Log.v(TAG, newRow.toString());
 }
 and
 private static Uri createCompleteUri(Uri uri)
 {
 Uri.Builder b = uri.buildUpon();
 b.appendQueryParameter(caller_is_syncadapter, true);
 b.appendQueryParameter(account_name, Com2Cal);
 b.appendQueryParameter(account_type, LOCAL);
 Uri calUri = b.build();
 Log.d(completeUri, calUri.toString());
 return calUri;
 }

 The calendar was created. I see him in the calendar app. But after the
 restart, the calendar no longer exists. Why?
 I add the calendar in a onClick event of a activity. I do not own
 SyncAdapter or so.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Android app with google calender

2012-07-09 Thread Michael Chan
Here's a developer guide with code snippets:
http://developer.android.com/guide/topics/providers/calendar-provider.html

On Mon, Jul 2, 2012 at 2:40 AM, Ali Chousein ali.chous...@gmail.com wrote:
 Certainly it is possible. Take a look at the CalendarContract interface:
 http://developer.android.com/reference/android/provider/CalendarContract.html

 -
 Ali Chousein
 https://play.google.com/store/apps/details?id=com.apps.social_nav
 https://play.google.com/store/apps/details?id=com.apps.weather_buddy
 http://www.paygol.com/android/implementation

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] GoogleCalendarSyncAdapter - any limit on syncing calendar events from google server

2012-06-29 Thread Michael Chan
Hi,

The GoogleCalendarSyncAdapter's sync window is currently one month
back and one year forward. It won't sync any event that ended earlier
than a month ago.

GoogleCalendarSyncAdapter does not have a limit on the number of
event. Of course, there storage limits and the database will be slow
and unusable at some point.

Thanks,
Mike

On Tue, Jun 26, 2012 at 11:04 PM, Raghu raghu4...@gmail.com wrote:
 Hi

 I have few questions about Android GoogleCalendarSyncAdapter
 application.
 As per my understnading this application is useful to sync google
 calendar events between google server and android phone.

 1. Android phone can display calendar range 1902 January 1 to 2036
 December 31st.
   if I have last 10 years of gmail calendar events, is it possible to
 sync all these events? (Assume device memory  is large enough.)

 2. While performing syncing, Will this application request only for
 limited time calendar events (EX: last 30 days) or will it sync all
 calendar events from server at the same time?
     how excatly GoogleCalendarSyncworks?

 3. is there any limit on number of calendar events for syncing?

 Could anyone help me in finding answers for above questions.
 Thank you.

 Raghu

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Custom alarm for calendar events

2012-06-20 Thread Michael Chan
Sorry. The stock Calendar app does not play different sounds for
different events. There's no API in the provider to support this
either.

On Wed, Jun 20, 2012 at 3:40 AM, Sourav Howlader
sourav.howla...@gmail.com wrote:
 Hi All,

 I am trying to create events in default Calendar and set alarm for it.
 This much is fine, I am able to set events and alarm for the events using
 Intent.
 Now instead of playing default calendar alert sound I want to play different
 different sound for the events which I have added.
 This is where I am facing problem. One alternative I got is to create own
 calendar and set the events.

 Is there any other better way to achieve this? Please suggest. Thanks in
 advance.

 Regards,
 Sourav

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Calendar EditEventHelper test case

2012-06-13 Thread Michael Chan
Thank you. I will integrate your fix into the repro.

On Mon, Jun 11, 2012 at 6:48 AM, Daniel Kang doojin.k...@gmail.com wrote:

 Hello,

 I'm doing some Unit Test with Android Calendar application.
 In the test code in EditEventHelperTest.java, lots of testSaveEvent*
 encountered java.lang.NullPointerException.
 This comes from AsyncQueryService. startBatch(...).


public void startBatch(int token, Object cookie, String authority,
ArrayListContentProviderOperation cpo, long delayMillis)
 {
OperationInfo info = new OperationInfo();
info.op = Operation.EVENT_ARG_BATCH;
info.resolver = mContext.getContentResolver();
info.handler = mHandler;

 getContentResolver() cause NULL pointer exception.

 I found null resolver derived from wrong mContext. Not in test case
 mContext type is EditEventActivity, but in test case the type is
 MockAbsCalendarActivity.
 MockAbsCalendarActivity in EditEventHelperTest.java is mock test
 module and defines new startBatch for test module.

 I changed EditEventHelper creator code like this

public EditEventHelper(Context context, CalendarEventModel model)
 {
 //mService = new AsyncQueryService(context);
mService =
 ((AbstractCalendarActivity)context).getAsyncQueryService();
}

 This removes Null pointer exception and run test case with right
 startBatch function.

 Thanks

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] how can i get .project and .classpath from the build.gradle?

2012-06-12 Thread Dicky Chan
i got a source file from web and i wanna open this project on eclipse,
how can i get .project and .classpath from the build.gradle?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] How to acheive feature like this

2012-05-16 Thread Michael Chan
It is a custom view drawn on a canvas.
http://developer.android.com/guide/topics/graphics/2d-graphics.html#draw-with-canvas


On Wed, May 16, 2012 at 5:57 AM, zerocool luvme...@gmail.com wrote:

 Hi all,

 Can any one tell me how can i acheive feature like this, the bar diagrams
 feature representing appointments and timelining feature, in a calendar.


 https://lh5.googleusercontent.com/-b8ObqGMs5FU/T7OkLLhlxgI/AiM/Kq1xJH4bTn8/s1600/snap20100826220620.png

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] ICS : Why this source code crash in query ?

2012-05-15 Thread Michael Chan
Hi,

What do you see in logcat? i.e. what's the crash? Also does your app have
calendar read permission?
http://developer.android.com/guide/topics/providers/calendar-provider.html#manifest

Thanks,
Mike

On Mon, May 14, 2012 at 12:43 PM, chronogps chrono...@free.fr wrote:

 I try to read google agenda content with following code (from here :
 http://developer.android.com/guide/topics/providers/calendar-provider.html
 )

 The code crach at : cur = cr.query(uri, EVENT_PROJECTION, selection,
 selectionArgs, null);

 I'm running this source code on my Acer A500 / ICS 4.0.3 (as it is not
 possible to manage agenda on the emulator).

 Any idea to fix the app crash ?


final int PROJECTION_ID_INDEX = 0;
final int PROJECTION_ACCOUNT_NAME_INDEX = 1;
final int PROJECTION_DISPLAY_NAME_INDEX = 2;
final int PROJECTION_OWNER_ACCOUNT_INDEX = 3;

// Projection array. Creating indices for this
 array instead of
 doing
// dynamic lookups improves performance.
final String[] EVENT_PROJECTION = new String[]
{
Calendars._ID,   //
 0
Calendars.ACCOUNT_NAME,  //
 1
Calendars.CALENDAR_DISPLAY_NAME  //
 2
};


// Run query
Cursor cur = null;
ContentResolver cr = getContentResolver();
Uri uri = Calendars.CONTENT_URI;
String selection = (( + Calendars.ACCOUNT_NAME +
  = ?) AND (
+ Calendars.ACCOUNT_TYPE +
  = ?));
String[] selectionArgs = new String[] {
 chrono...@gmail.com,
 com.google};

// Submit the query and get a Cursor object back.

cur = cr.query(uri, EVENT_PROJECTION, selection,
 selectionArgs,
 null);

// Use the cursor to step through the returned
 records
while (cur.moveToNext())
{
long calID = 0;
String displayName = null;
String accountName = null;
// Get the field values
calID = cur.getLong(PROJECTION_ID_INDEX);
displayName =
 cur.getString(PROJECTION_DISPLAY_NAME_INDEX);
accountName =
 cur.getString(PROJECTION_ACCOUNT_NAME_INDEX);
// Do something with the values...
}

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] how to send commands to OS through bluetooth

2012-05-09 Thread shahfaizal chan basha
i want to send commands to OS thourgh bluetooth, where my system
should handle it by is own bluetooth service listener.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] How to build row item child views that can overlap rows, for a custom calendar application

2012-05-04 Thread Michael Chan
Hi,

Have a look at:
http://developer.android.com/guide/topics/ui/dialogs.html
http://developer.android.com/guide/topics/ui/notifiers/notifications.html
http://developer.android.com/guide/topics/ui/menus.html

Thanks,
Mike

On Fri, May 4, 2012 at 3:31 PM, David Ozersky
somethingcleve...@gmail.com wrote:
 Thanks Mark,

 I've given up on that solution.  But I'm just wondering...how does Android
 display notifactions and context menu's?  Is it placed directly on the
 FrameLayout of the Window? Or is it something else?

 Thank you for your help, and you're support of the community.

 David


 On Fri, May 4, 2012 at 5:37 PM, Mark Murphy mmur...@commonsware.com wrote:

 On Fri, May 4, 2012 at 5:27 PM, duadinam somethingcleve...@gmail.com
 wrote:
  BTW, I love the Commonsware book series, I use them all the time.

 Thanks!

  What if the
  Events sit above the ListItems, in the same way that a context menu
  would?

 Then you would not be able to interact with things other than the
 events, just as you cannot interact with the UI of an activity while
 the foreground is occupied by a context menu.

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 _The Busy Coder's Guide to Android Development_ Version 3.7 Available!

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] tabgroup activity current actity name from current tab

2012-05-03 Thread shahfaizal chan basha
i am using tab activity where all tabs contains their own tab group
activity.

When ever i print  tabhost.getcurrentactivity() i get only tabgroup
name which launched from tabhost i need to get the child activity name
of the current tab.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] How to build row item child views that can overlap rows, for a custom calendar application

2012-05-03 Thread Michael Chan
Hi,

The day and week views are custom drawn i.e. line by line, rect by
rect, etc. It does not use a ListView.

The agenda view uses a ListView. One row per header or event.
Nothing spans across multiple rows.
The month view (starting in Honeycomb, I believe) uses a ListView. One
row per week. Each week is custom drawn.

Are you doing any custom drawing? How do you plan to handle events
that overlaps in time? e.g. 1pm - 3pm  1pm - 2pm

Thanks,
Mike

On Thu, May 3, 2012 at 6:47 AM, Mark Murphy mmur...@commonsware.com wrote:
 On Thu, May 3, 2012 at 9:40 AM, duadinam somethingcleve...@gmail.com wrote:
 1) If each hour slot is a single row in a ListView, how do you create events
 that cross rows?  It seems you would have to have views that belong to two
 parents, which doesn't seem possible.

 That's not necessarily the case. You could have several rows that look
 like they form one contiguous event (e.g., colored bubble), even
 though they are composed of multiple row views. You would have four
 basic row styles for rows with an event:

 - One where the entire event fits in the row (whole bubble)
 - One where the row is the beginning of the event (top of the bubble)
 - One where the row is the end of the event (bottom of the bubble)
 - One where the row is in the middle of the event

 So long as the widths and colors and such are set up properly, the
 user will see one tall bubble instead of perceiving distinct rows.

 2) Along the same line, how would you create 2 events in a one-hour slot?
  Can you populate one row in a ListView with two items?

 You can make a single ListView row be as complicated as you wish.
 However, from the standpoint of the Adapter, you cannot have two
 adapter positions in one row of a ListView. So, you would not have an
 EventsAdapter, but an HoursAdapter. You would need that anyway, to
 handle hours without any events.

 Any suggestions or ideas?

 Port the iosched timeline to a standalone component and use that:

 http://code.google.com/p/iosched/

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 Android Training...At Your Office: http://commonsware.com/training

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Add Weekly,Fortnightly,Monthly Recurring events to calendar.

2012-04-23 Thread Michael Chan
Hi,

Please take a look at the 4th bullet in
http://developer.android.com/guide/topics/providers/calendar-provider.html#add-event

What do you mean by it doesn't work?
What do you see in the logcat?
Did you get an exception? If so, please share.
What did resolver.insert() return? If the insert was successful,
resolver.insert() should return a uri to the event. If you get a uri
but can't find the event in the Calendar app, double check the dtstart
i.e. put it in a Time object, print it out and verify.

For fortnightly, the rrule is FREQ=DAILY;INTERVAL=2
To learn more about rrules, read
http://tools.ietf.org/html/rfc5545#section-3.8.5.3. If you don't want
to bother, just add an event using the web or another app then query
the rrule of that event and see what you get.

Don't hard code calendar_id to 1. Let the user pick a calendar.

Thanks,
Mike

On Sun, Apr 22, 2012 at 2:06 AM, Deepak deepakvs...@gmail.com wrote:
 I'm trying to add event to the calendar programatically in Android API
 11. It does not seem to be working, I've pasted the code, also didn't
 find anything on adding fortnightly events. Please if anyone can tell
 what is the issue in the code below.
        ContentValues event = new ContentValues();
                event.put(calendar_id, 1);
                event.put(title, title);
                event.put(description, description);
                event.put(eventLocation, location);
                event.put(dtstart, startDate);
                switch (recurrance) {
                case DAILY:
                        event.put(rrule, FREQ=DAILY);
                        break;
                case MONTHLY:
                        event.put(rrule, FREQ=MONTHLY);
                        break;
                case WEEKLY:
                        event.put(rrule, FREQ=WEEKLY);
                        break;
                case FORTNIGHTLY:
                        event.put(rrule, FREQ=YEARLY); //CODE for 
 Fortnight to be
 added.
                        break;
                }
                event.put(dtend, endDate);
                if (Integer.parseInt(Build.VERSION.SDK) = 8) {
                        Uri eventsUri = 
 Uri.parse(content://com.android.calendar/events);
                        resolver.insert(eventsUri, event);
                } else {
                        Uri eventsUri = Uri.parse(content://calendar/events);
                        resolver.insert(eventsUri, event);
                }

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: How to use AlarmManager on Dialog?

2012-04-03 Thread Michael Chan
Hi,

'new
Intent(com.siitne.candelaria.notificationSystem.AvisoReceiver.class)'
is not valid Intent unless
com.siitne.candelaria.notificationSystem.AvisoReceiver.class is
valid action. Can you try sending the intent from onClick() and make
sure that works first?

Thanks,
Mike

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Calendar edit event force close error....

2012-03-25 Thread Michael Chan
What's error? Can you show include the stack trace?

On Sat, Mar 24, 2012 at 1:08 PM, Jast Vacaty jastpower...@gmail.com wrote:
 Hi,

 I am trying to add calendar events by use my application. Event gets saved
 successfully. However when I try to edit event that saved successfully. I
 get the Force Close error.

             Cursor userCursor
 =getContentResolver().query(Uri.parse(calanderURL),null, null, null, null);
             if(userCursor.getCount()  0){
                 userCursor.moveToFirst();
                 calId =
 userCursor.getString(userCursor.getColumnIndex(_id));
                 }
             ContentValues event = new ContentValues();
             event.put(title, title);
             event.put(description, description);
             event.put(eventLocation, Event Location);
             event.put(allDay, 0);
             event.put(hasAlarm,0);
             event.put(calendar_id,calId);
             Calendar mCalendar = Calendar.getInstance();
             mCalendar.set(2012, 2, 27,7,00,00);
             long start = mCalendar.getTimeInMillis();
             mCalendar.set(2012, 2, 27,8,00,00);
             long end = mCalendar.getTimeInMillis();
             event.put(dtstart,  start);
             event.put(dtend, end);


             Uri newEvent = Uri.parse(calanderEventURL);
             getContentResolver().insert(newEvent, event);
     userCursor.close();

 But when I chang the event.put(allDay, 0); to event.put(allDay,1).

 Event gets edited successfully .

 How do i fix it?

 I am asking for any help.Thanks.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Duplicate Calendar Event

2012-03-14 Thread Michael Chan
Have a look at Querying a calendar in the link I gave you and
replace the following:

  Uri uri = Events.CONTENT_URI;
  String selection = Events.TITLE +  = ? AND 
+ Events.DTSTART +  = ? AND 
+ Events.DTEND +  = ?;
  String[] selectionArgs = new String[] {title,
Long.toString(startTimeInMillis), Long.toString(endTimeInMillis)};

In the projection, use Events._ID for the event id.


On Tue, Mar 13, 2012 at 11:47 PM, giles ian gilesian@gmail.com wrote:
 Thanks Mike you your answer.

 Now my question is how do i check if a particular event is already present.

 Basically i want a select with where clause (for title,start date and end
 date)


 On Wed, Mar 14, 2012 at 12:01 AM, Michael Chan mc...@android.com wrote:

 Hi Giles,

 The code below will add an event every time onClick is called since
 it's doing an insert().  If you want to modify an existing event, you
 need to get the event id via a query then do an update. Search for
 Updating Events in
 http://developer.android.com/guide/topics/providers/calendar-provider.html

 Thanks,
 Mike

 On Tue, Mar 13, 2012 at 7:28 AM, giles ian gilesian@gmail.com wrote:
  Hi,
 
  I am using the below code for adding events.
 
  Now the issue is im able to add same event (all details same) multiple
  times.
 
  How to i avoid this.
 
 
 
  public static void addToCalendar(Context ctx, final String title,
 
  final long dtstart, final long dtend) {
 
  final ContentResolver cr = ctx.getContentResolver();
 
  Cursor cursor;
 
  if (Integer.parseInt(Build.VERSION.SDK) = 8)
 
  cursor = cr.query(
 
  Uri.parse(content://com.android.calendar/calendars),
 
  new String[] { _id, displayname }, null, null, null);
 
  else
 
  cursor = cr.query(Uri.parse(content://calendar/calendars),
 
  new String[] { _id, displayname }, null, null, null);
 
  if (cursor.moveToFirst()) {
 
  final String[] calNames = new String[cursor.getCount()];
 
  final int[] calIds = new int[cursor.getCount()];
 
  for (int i = 0; i  calNames.length; i++) {
 
  calIds[i] = cursor.getInt(0);
 
  calNames[i] = cursor.getString(1);
 
  cursor.moveToNext();
 
  }
 
 
  AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
 
  builder.setSingleChoiceItems(calNames, -1,
 
  new DialogInterface.OnClickListener() {
 
 
  @Override
 
  public void onClick(DialogInterface dialog, int which) {
 
  ContentValues cv = new ContentValues();
 
  cv.put(calendar_id, calIds[which]);
 
  cv.put(title, title);
 
  cv.put(dtstart, dtstart);
 
  cv.put(hasAlarm, 1);
 
  cv.put(dtend, dtend);
 
 
  Uri newEvent;
 
  if (Integer.parseInt(Build.VERSION.SDK) = 8)
 
  newEvent = cr.insert(
 
  Uri.parse(content://com.android.calendar/events),
 
  cv);
 
  else
 
  newEvent = cr.insert(
 
  Uri.parse(content://calendar/events),
 
  cv);
 
 
  if (newEvent != null) {
 
  long id = Long.parseLong(newEvent
 
  .getLastPathSegment());
 
  ContentValues values = new ContentValues();
 
  values.put(event_id, id);
 
  values.put(method, 1);
 
  values.put(minutes, 0); // 15 minuti
 
  if (Integer.parseInt(Build.VERSION.SDK) = 8)
 
  cr.insert(
 
  Uri.parse(content://com.android.calendar/reminders),
 
  values);
 
  else
 
  cr.insert(
 
  Uri.parse(content://calendar/reminders),
 
  values);
 
 
  }
 
  dialog.cancel();
 
  }
 
 
  });
 
 
  builder.create().show();
 
  }
 
  cursor.close();
 
  }
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Duplicate Calendar Event

2012-03-13 Thread Michael Chan
Hi Giles,

The code below will add an event every time onClick is called since
it's doing an insert().  If you want to modify an existing event, you
need to get the event id via a query then do an update. Search for
Updating Events in
http://developer.android.com/guide/topics/providers/calendar-provider.html

Thanks,
Mike

On Tue, Mar 13, 2012 at 7:28 AM, giles ian gilesian@gmail.com wrote:
 Hi,

 I am using the below code for adding events.

 Now the issue is im able to add same event (all details same) multiple
 times.

 How to i avoid this.



 public static void addToCalendar(Context ctx, final String title,

 final long dtstart, final long dtend) {

 final ContentResolver cr = ctx.getContentResolver();

 Cursor cursor;

 if (Integer.parseInt(Build.VERSION.SDK) = 8)

 cursor = cr.query(

 Uri.parse(content://com.android.calendar/calendars),

 new String[] { _id, displayname }, null, null, null);

 else

 cursor = cr.query(Uri.parse(content://calendar/calendars),

 new String[] { _id, displayname }, null, null, null);

 if (cursor.moveToFirst()) {

 final String[] calNames = new String[cursor.getCount()];

 final int[] calIds = new int[cursor.getCount()];

 for (int i = 0; i  calNames.length; i++) {

 calIds[i] = cursor.getInt(0);

 calNames[i] = cursor.getString(1);

 cursor.moveToNext();

 }


 AlertDialog.Builder builder = new AlertDialog.Builder(ctx);

 builder.setSingleChoiceItems(calNames, -1,

 new DialogInterface.OnClickListener() {


 @Override

 public void onClick(DialogInterface dialog, int which) {

 ContentValues cv = new ContentValues();

 cv.put(calendar_id, calIds[which]);

 cv.put(title, title);

 cv.put(dtstart, dtstart);

 cv.put(hasAlarm, 1);

 cv.put(dtend, dtend);


 Uri newEvent;

 if (Integer.parseInt(Build.VERSION.SDK) = 8)

 newEvent = cr.insert(

 Uri.parse(content://com.android.calendar/events),

 cv);

 else

 newEvent = cr.insert(

 Uri.parse(content://calendar/events),

 cv);


 if (newEvent != null) {

 long id = Long.parseLong(newEvent

 .getLastPathSegment());

 ContentValues values = new ContentValues();

 values.put(event_id, id);

 values.put(method, 1);

 values.put(minutes, 0); // 15 minuti

 if (Integer.parseInt(Build.VERSION.SDK) = 8)

 cr.insert(

 Uri.parse(content://com.android.calendar/reminders),

 values);

 else

 cr.insert(

 Uri.parse(content://calendar/reminders),

 values);


 }

 dialog.cancel();

 }


 });


 builder.create().show();

 }

 cursor.close();

 }

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Calendar on Emulator with ICS

2012-03-08 Thread Michael Chan
Hi,

Try the following:
adb root
wait a couple seconds
adb shell sqlite3
/data/data/com.android.providers.calendar/databases/calendar.db
INSERT INTO Calendars
VALUES(null,'YOUR_APP','local',NULL,NULL,'Test_Calendar','Test_Calendar',0,NULL,700,1,0,NULL,'America/Los_Angeles','test_account',1,1,1,5,'0,1,2','0,1','0,1,2',0,null,null,null,null,null,NULL,NULL,null,NULL,NULL);

Thanks,
Mike

On Fri, Mar 2, 2012 at 12:52 AM, Forum JD jd.tec...@gmail.com wrote:
 Hello All,

 I am very new to android development. I am trying to develop an
 application where I want to use the new public Calendar API of ICS.
 The problem is that on simulator I do see a calendar icon but I cannot
 add events to it. It asked me every time to add an account. I added my
 gmail account and enabled sync on simulator and it showed me my email
 folders but did not sync the calender. Due to this, I do not have any
 test data and a test calender on the simulator and hence when I try
 try read all the calenders on the device, the list is just empty.

 How do I get a test calender in emulator to test my application?
 Unfortunately I have a android phone but it has OS version of 2.3
 (Samsung galaxy S) and I do not think it would get upgrade soon to
 ICS. Please help me out with this.

 JD

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Event listner for calender event like meetings in ICS

2012-03-08 Thread Michael Chan
Hi,

There's nothing built-in for that. If I were to implement that, I would:
1) Write some code that queries the Calendar provider and have
AlarmManager wake up the phone and send you an intent at the
appropriate times for the remainder of today. This method may be
called more frequently then needed. You will should keep track of what
you have scheduled or not so you don't schedule anything
unnecessarily.
2) Have AlarmManager wake you up at midnight so you can call method #1
3) Listen for the ACTION_BOOT_COMPLETED broadcast so you can schedule
your midnight alarm and call method #1. Alarms do not persist across
reboots.
4) Listen for android.intent.action.PROVIDER_CHANGED so you know when
something has changed and you know... call method #1.
 intent-filter
action android:name=android.intent.action.PROVIDER_CHANGED/
data android:scheme=content/
data android:host=com.android.calendar/
/intent-filter
5) Listen for the date, time, and timezone change broadcasts and again
call method #1.

I think that should cover all the cases.

Thanks,
Mike

On Fri, Mar 2, 2012 at 3:50 AM, Forum JD jd.tec...@gmail.com wrote:
 I am using android ICS new calendar API. I want to do some action when an
 event from calendar start and stops. Say for example I have a meeting in my
 calender at 5.30 Saturday to 6.00 PM i want to do some action at 5.29 and
 6.01 PM. Is there any listener that I can configure for such events? I can
 read the event details from calender and write a lot of custom code to do so
 but just wanted to know if there is any other mechanism to do so? In case I
 need to read all the event details in calender, is there any service which I
 can use which calls back my class at a certain time? Just like springs
 scheduler or something?

 JD

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] ICS calendar event setup issue

2012-02-17 Thread Michael Chan
 Is there a way to make it show the day like Gingerbread did?

No. We have a bug internally to get that fixed.

Thanks,
Mike

On Thu, Feb 16, 2012 at 9:21 AM, Greg Lozano-Buhl g...@lozano-buhl.com wrote:
 I've noticed that ICS no longer shows the day of the week
 corresponding to the selected date when setting up a calendar event.
 This makes it hard to setup a multi-day event in the instance that I
 want the event to end on, say, Thursday when I do not know what date
 Thursday is. Is there a way to make it show the day like Gingerbread
 did?


 ICS screenshot (doesn't show day):
   
 http://cdn.androidpolice.com/wp-content/uploads/2011/11/wm__0012_2011-11-02-14h34_19.jpg

 Corresponding Gingerbread screenshot (DOES show day):
  http://cdn.androidpolice.com/wp-content/uploads/2011/11/wm__0002_screenshot-1320258879006.jpg

 -Greg

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Help with strange OpenGL ES 2.0 Methods

2012-02-11 Thread Th Chan
Hi,

I'm trying to use the functions below from GLES20 in Android with API
level 14. Can someone shed some light on why the last argument is of
type byte? I checked the NDK equivalent and it's a char *. I checked
the official OpenGL ES API and it's a char *. I assume it should be a
String or char[] or CharBuffer or something?

Am I missing something here? How do I use these functions?

Thanks.

glGetShaderSource(int shader, int bufsize, IntBuffer length, byte
source)
glGetActiveAttrib(int program, int index, int bufsize, IntBuffer
length, IntBuffer size, IntBuffer type, byte name)
glGetActiveUniform(int program, int index, int bufsize, IntBuffer
length, IntBuffer size, IntBuffer type, byte name)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: No luck with new ICS CalenderContract

2011-12-19 Thread Michael Chan
Hi,

In case you haven't seen it, the developer guide for calendar API's
and intents are available at:
http://developer.android.com/guide/topics/providers/calendar-provider.html

Thanks,
Mike

On Thu, Nov 3, 2011 at 11:36 AM, Mark Murphy mmur...@commonsware.com wrote:
 On Thu, Nov 3, 2011 at 2:29 PM, Michael Chan mc...@android.com wrote:
 We will be publishing a developer guide for Calendar APIs with more
 details on the set of supported intents as well as code snippets.

 Great! Be sure to spread the news when they're released. :-)

 Thanks!

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 Warescription: Three Android Books, Plus Updates, One Low Price!

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Is google calendar api is public yet

2011-12-19 Thread Michael Chan
The developer guide is available at
http://developer.android.com/guide/topics/providers/calendar-provider.html

On Sun, Dec 18, 2011 at 6:09 PM, TreKing treking...@gmail.com wrote:
 On Thu, Dec 15, 2011 at 3:39 PM, Bhupi bhupendr...@gmail.com wrote:

 I am planning to use calender api and couldn't find any documentation.


 You couldn't? Come on.
 http://developer.android.com/search.html#q=calendart=0

 -
 TreKing - Chicago transit tracking app for Android-powered devices

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Task implentation

2011-11-14 Thread Michael Chan
Hi,
There's no Android API for getting Tasks data
(https://mail.google.com/mail/help/tasks/).
You will have to use GData directly
(http://code.google.com/apis/tasks/). I believe someone has a
open-source implementation already. Look around.
Thanks,Mike
On Sun, Nov 13, 2011 at 8:36 PM, kishore vkishore...@gmail.com wrote:
 Hi All,

 For calendar information i am getting from this URI:
 Uri.parse(content://com.android.calendar/calendars)

 In same way i need to get TASK information or TASK list. Can any one
 tell me any URI is there for TASK.
 or any other way to implement

 Please give information about TASK.

 Regards,
 Kishore

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Problem in retrieve content:encoded by SAX form RSS

2011-11-11 Thread calvin chan
Hi everyone,

I am a beginner of android programming, these several weeks I am
trying to write a RSS reader.
As I said, I use SAX to retrieve the elements from xml of a website.
All other elements I can retrieve except the content inside the
content:encoded.

Below is my Handler.java
can anyone help me?
thz so much~~~
__
package first.user_ss;

import java.util.ArrayList;
import java.util.List;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class MyHandler extends DefaultHandler{

  private boolean in_item = false;
  private boolean in_title = false;
  private boolean in_link = false;
  private boolean in_desc = false;
  private boolean in_date = false;
  private boolean in_contentencoded =false;   //it is added by myself
  private boolean in_cate=false;
  private boolean in_mainTitle = false;
  private ListNews li;
  private News news;
  private String title=;
  private StringBuffer buf=new StringBuffer();

  public ListNews getParsedData()
  {
return li;
  }
  public String getRssTitle()
  {
return title;
  }
  @Override
  public void startDocument() throws SAXException
  {
li = new ArrayListNews();
  }
  @Override
  public void endDocument() throws SAXException
  {
  }
  @Override
  public void startElement(String namespaceURI, String localName,
String qName, Attributes atts) throws SAXException
  {
if (localName.equals(item))
{
  this.in_item = true;
  news=new News();
}
else if (localName.equals(title))
{
  if(this.in_item)
  {
this.in_title = true;
  }
  else
  {
this.in_mainTitle = true;
  }
}
else if (localName.equals(link))
{
  if(this.in_item)
  {
this.in_link = true;
  }
}
else if (localName.equals(description))
{
  if(this.in_item)
  {
this.in_desc = true;
  }
}
else if (localName.equals(pubDate))
{
  if(this.in_item)
  {
this.in_date = true;
  }
}
   else if (localName.equals(content:encoded))
{
  if(this.in_item)
  {
this.in_contentencoded = true;
  }
}
   else if (localName.equals(category))
{
  if(this.in_item)
  {
this.in_cate = true;
  }
}
  }
  @Override
  public void endElement(String namespaceURI, String localName,
String qName) throws SAXException
  {
if (localName.equals(item))
{
  this.in_item = false;
  li.add(news);
}
else if (localName.equals(title))
{
  if(this.in_item)
  {
news.setTitle(buf.toString().trim());
buf.setLength(0);
this.in_title = false;
  }
  else
  {
title=buf.toString().trim();
buf.setLength(0);
this.in_mainTitle = false;
  }
}
else if (localName.equals(link))
{
  if(this.in_item)
  {
news.setLink(buf.toString().trim());
buf.setLength(0);
this.in_link = false;
  }
}
else if (localName.equals(description))
{
  if(in_item)
  {
news.setDesc(buf.toString().trim());
buf.setLength(0);
this.in_desc = false;
  }
}
else if (localName.equals(pubDate))
{
  if(in_item)
  {
news.setDate(buf.toString().trim());
buf.setLength(0);
this.in_date = false;
  }
}
  else if (localName.equals(content:encoded))
{
  if(this.in_item)
  {
news.setCon(buf.toString().trim());
buf.setLength(0);
this.in_contentencoded = false;
  }
}

  else if (localName.equals(category))
{
  if(in_item)
  {
news.setCate(buf.toString().trim());

Re: [android-developers] Re: No luck with new ICS CalenderContract

2011-11-07 Thread Michael Chan
Hi,

 Are you saying there is no way to help the user subscribe to a public google 
 calendar via the new calendar api?
There just isn't a *supported* way via the Android Calendar API. (You
can always do some reverse engineering and get something that work for
now. But it may break suddenly one day when the user gets an update.
So I really really want discourage everyone from doing that.)

 Is there a better, more supported way to do this?

The only supported way today is to talk to the server directly via the
GData api.  You need to figure out how to get the credentials.
http://code.google.com/apis/calendar/data/2.0/developers_guide.html
Looks like the code below is doing that.

 Also what do you mean by using the browser?  Can I make the calendar
 visible and sync'ed via the browser?

2 way:
1) Instruct the user to do it manually
2) Send the user to
https://www.google.com/calendar/render?cid=calendar ID or
http://www.google.com/calendar/hosted/domain/render?cid=calendar
ID. The user has to say they want to use the desktop UI, zoom in, and
click Yes, add this calendar. It is not a great experience.  The
other drawback here is that the user won't be able to choose which
account the calendar should be added to.

Thanks,
Mike

On Fri, Nov 4, 2011 at 6:13 PM, Ralph fed...@gmail.com wrote:
 Hi Michael,

 Thanks again.

 Are you saying there is no way to help the user subscribe to a public
 google calendar via the new calendar api?

 I am already subscribing using some example from Yaniv Inbar a while
 back:

 where ALERT_CALENDAR is nyc.ale...@brooklynmarathon.com

 Is there a better, more supported way to do this?

 Also what do you mean by using the browser?  Can I make the calendar
 visible and sync'ed via the browser?


 Thanks,
 Ralph

  private void subscribeCalendar()
  {
    CalendarUrl url  = CalendarUrl.forAllCalendarsFeed();
    Log.i(TAG,ADD NEW CALENDAR:  + url);
    CalendarEntry calendar = new CalendarEntry();
    //calendar should have something like setid of gdata api

    calendar.id = ALERT_CALENDAR;
    //calendar.title = Test:  + new DateTime(new Date());
    try {
      calendar.executeInsert(transport, url);

      AlertDialog builder;
      try {
          builder = MessageDialogBuilder.create(this, MESSAGE );
          builder.show();
      } catch (NameNotFoundException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
    } catch (IOException e) {
      handleException(e);
    }

  }

 On Nov 4, 12:38 pm, Michael Chan mc...@android.com wrote:
 Hi Ralph,

 I wish I have a solution for you. That's not supported right now. The only
 (not so good) way is to use the browser. I will file an internal feature
 request if we don't have one already.

 Thanks,
 Mike







 On Fri, Nov 4, 2011 at 7:24 AM, Ralph fed...@gmail.com wrote:
  Hi Michael and thank you.

  Can you let us know the recommended way to subscribe a user to a
  public google calendar.

  For example, let's say you have a google calendar with public
  information.  for example, some city alerts etc. data.

  We want to make it easy for the user to subscribe to the public
  calendar and make it sync'ed and visible (with their permission of
  course)

  Today, I have to give them instructions and it seems that each phone
  manufacturer has implemented the calendar in a different way so the
  instructions are very complicated.  What I'd like to send the user to
  a screen with the calendar subscription (visible and sync'ed) already
  set up and let them confirm it.

  Thanks,
  Ralph

  On Nov 3, 2:29 pm, Michael Chan mc...@android.com wrote:
   Hi,

   I believe the GoogleCalendarSyncAdapter was not included in the
   emulator. That's why you can't sync Google Calendars in the emulator.

   The new Calendar API will support viewing, adding events (not
   calendars) via Intents. The user will need to confirm before the event
   is saved.

   Adding *Google* calendars via the provider is not supported at this
   time.

   We will be publishing a developer guide for Calendar APIs with more
   details on the set of supported intents as well as code snippets.

   managedQuery has been deprecated. It can cause ANRs. The recommend way
   is to use a CursorLoader (http://developer.android.com/reference/
   android/content/CursorLoader.html).  If you just need to read the data
   and can close the query immediately, you can still do a query (in a
   non-UI thread), read the data you want, and close the cursor.

   Thanks,
   Mike

   On Nov 3, 8:20 am, Ralph fed...@gmail.com wrote:

Thanks again.

I can say that if you have access to an exchange server then the
following examples do work in the android 4.0 level 14 emulator using
google apis at the moment:

Insert an event via Intents:
                        Intent intent = new
  Intent(Intent.ACTION_INSERT)
                    .setType(vnd.android.cursor.item/event)
                    .putExtra

Re: [android-developers] Re: No luck with new ICS CalenderContract

2011-11-04 Thread Michael Chan
Hi Ralph,

I wish I have a solution for you. That's not supported right now. The only
(not so good) way is to use the browser. I will file an internal feature
request if we don't have one already.

Thanks,
Mike

On Fri, Nov 4, 2011 at 7:24 AM, Ralph fed...@gmail.com wrote:

 Hi Michael and thank you.

 Can you let us know the recommended way to subscribe a user to a
 public google calendar.

 For example, let's say you have a google calendar with public
 information.  for example, some city alerts etc. data.

 We want to make it easy for the user to subscribe to the public
 calendar and make it sync'ed and visible (with their permission of
 course)

 Today, I have to give them instructions and it seems that each phone
 manufacturer has implemented the calendar in a different way so the
 instructions are very complicated.  What I'd like to send the user to
 a screen with the calendar subscription (visible and sync'ed) already
 set up and let them confirm it.

 Thanks,
 Ralph

 On Nov 3, 2:29 pm, Michael Chan mc...@android.com wrote:
  Hi,
 
  I believe the GoogleCalendarSyncAdapter was not included in the
  emulator. That's why you can't sync Google Calendars in the emulator.
 
  The new Calendar API will support viewing, adding events (not
  calendars) via Intents. The user will need to confirm before the event
  is saved.
 
  Adding *Google* calendars via the provider is not supported at this
  time.
 
  We will be publishing a developer guide for Calendar APIs with more
  details on the set of supported intents as well as code snippets.
 
  managedQuery has been deprecated. It can cause ANRs. The recommend way
  is to use a CursorLoader (http://developer.android.com/reference/
  android/content/CursorLoader.html).  If you just need to read the data
  and can close the query immediately, you can still do a query (in a
  non-UI thread), read the data you want, and close the cursor.
 
  Thanks,
  Mike
 
  On Nov 3, 8:20 am, Ralph fed...@gmail.com wrote:
 
 
 
 
 
 
 
   Thanks again.
 
   I can say that if you have access to an exchange server then the
   following examples do work in the android 4.0 level 14 emulator using
   google apis at the moment:
 
   Insert an event via Intents:
   Intent intent = new
 Intent(Intent.ACTION_INSERT)
   .setType(vnd.android.cursor.item/event)
   .putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME,
   0)
   .putExtra(CalendarContract.EXTRA_EVENT_END_TIME,
   1000)
   .putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY ,
   false) // just included for completeness
   .putExtra(Events.TITLE, My Awesome Event)
   .putExtra(Events.DESCRIPTION, Heading out with
   friends to do something awesome.)
   .putExtra(Events.EVENT_LOCATION, Earth)
   .putExtra(Events.RRULE, FREQ=DAILY;COUNT=10)
   .putExtra(Events.AVAILABILITY,
   Events.AVAILABILITY_BUSY)
   .putExtra(Events.ACCESS_LEVEL,
   Events.ACCESS_PRIVATE)
   .putExtra(Intent.EXTRA_EMAIL,
   my.fri...@example.com);
  startActivity(intent);
 
   Enumerate:
 
   Uri uri =CalendarContract.Calendars.CONTENT_URI;
   Log.i(TAG, QQQ: uri:  + uri);
   String[] projection = new String[] {
  CalendarContract.Calendars._ID,
  CalendarContract.Calendars.ACCOUNT_NAME,
  CalendarContract.Calendars.ACCOUNT_TYPE,
  CalendarContract.Calendars.NAME,
 
  CalendarContract.Calendars.CALENDAR_DISPLAY_NAME,
  
  CalendarContract.Calendars.CALENDAR_COLOR,
 
  CalendarContract.Calendars.CALENDAR_ACCESS_LEVEL,
  
  CalendarContract.Calendars.OWNER_ACCOUNT,
  CalendarContract.Calendars.SYNC_EVENTS,
  
  CalendarContract.Calendars.CALENDAR_TIME_ZONE,
  
  CalendarContract.Calendars.ALLOWED_REMINDERS,
  CalendarContract.Calendars.VISIBLE
 
   };
 
   Cursor calendarCursor = managedQuery(uri,
 projection,
   null, null, null);
   Log.i(TAG, cursor:  + calendarCursor);
   if (calendarCursor != null)
   {
   while (calendarCursor.moveToNext())
   {
  //Log.i(TAG, queryDatabase:  title:  +
   cursor.getString(cursor.getColumnIndex(Notes.TITLE)) +  note:  +
   cursor.getString(cursor.getColumnIndex(Notes.NOTE)));
   Log.i(TAG, QQQ2: cursor: _ID:  +
   calendarCursor.getColumnIndex(CalendarContract.Calendars._ID));
   for (int i = 0; i 
   calendarCursor.getColumnCount(); i

[android-developers] Re: No luck with new ICS CalenderContract

2011-11-03 Thread Michael Chan
Hi,

I believe the GoogleCalendarSyncAdapter was not included in the
emulator. That's why you can't sync Google Calendars in the emulator.

The new Calendar API will support viewing, adding events (not
calendars) via Intents. The user will need to confirm before the event
is saved.

Adding *Google* calendars via the provider is not supported at this
time.

We will be publishing a developer guide for Calendar APIs with more
details on the set of supported intents as well as code snippets.

managedQuery has been deprecated. It can cause ANRs. The recommend way
is to use a CursorLoader (http://developer.android.com/reference/
android/content/CursorLoader.html).  If you just need to read the data
and can close the query immediately, you can still do a query (in a
non-UI thread), read the data you want, and close the cursor.

Thanks,
Mike

On Nov 3, 8:20 am, Ralph fed...@gmail.com wrote:
 Thanks again.

 I can say that if you have access to an exchange server then the
 following examples do work in the android 4.0 level 14 emulator using
 google apis at the moment:

 Insert an event via Intents:
                         Intent intent = new Intent(Intent.ACTION_INSERT)
                     .setType(vnd.android.cursor.item/event)
                     .putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME,
 0)
                     .putExtra(CalendarContract.EXTRA_EVENT_END_TIME,
 1000)
                     .putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY ,
 false) // just included for completeness
                     .putExtra(Events.TITLE, My Awesome Event)
                     .putExtra(Events.DESCRIPTION, Heading out with
 friends to do something awesome.)
                     .putExtra(Events.EVENT_LOCATION, Earth)
                     .putExtra(Events.RRULE, FREQ=DAILY;COUNT=10)
                     .putExtra(Events.AVAILABILITY,
 Events.AVAILABILITY_BUSY)
                     .putExtra(Events.ACCESS_LEVEL,
 Events.ACCESS_PRIVATE)
                     .putExtra(Intent.EXTRA_EMAIL,
 my.fri...@example.com);
            startActivity(intent);

 Enumerate:

                 Uri uri = CalendarContract.Calendars.CONTENT_URI;
                         Log.i(TAG, QQQ: uri:  + uri);
                         String[] projection = new String[] {
                                CalendarContract.Calendars._ID,
                                CalendarContract.Calendars.ACCOUNT_NAME,
                                CalendarContract.Calendars.ACCOUNT_TYPE,
                                CalendarContract.Calendars.NAME,

 CalendarContract.Calendars.CALENDAR_DISPLAY_NAME,
                                CalendarContract.Calendars.CALENDAR_COLOR,

 CalendarContract.Calendars.CALENDAR_ACCESS_LEVEL,
                                CalendarContract.Calendars.OWNER_ACCOUNT,
                                CalendarContract.Calendars.SYNC_EVENTS,
                                CalendarContract.Calendars.CALENDAR_TIME_ZONE,
                                CalendarContract.Calendars.ALLOWED_REMINDERS,
                                CalendarContract.Calendars.VISIBLE

                         };

                         Cursor calendarCursor = managedQuery(uri, projection,
 null, null, null);
                         Log.i(TAG, cursor:  + calendarCursor);
                     if (calendarCursor != null)
                     {
                         while (calendarCursor.moveToNext())
                         {
                            //Log.i(TAG, queryDatabase:  title:  +
 cursor.getString(cursor.getColumnIndex(Notes.TITLE)) +  note:  +
 cursor.getString(cursor.getColumnIndex(Notes.NOTE)));
                                 Log.i(TAG, QQQ2: cursor: _ID:  +
 calendarCursor.getColumnIndex(CalendarContract.Calendars._ID));
                                 for (int i = 0; i 
 calendarCursor.getColumnCount(); i++) {
                                         Log.i(TAG, QQQ2: cursor: name:  + i 
 +  =
  + calendarCursor.getColumnName(i));
                                         Log.i(TAG, QQQ2: cursor: type:  + i 
 +  =
  + calendarCursor.getType(i));
                                         switch(calendarCursor.getType(i)){
                                         case Cursor.FIELD_TYPE_STRING:
                                                 Log.i(TAG, QQQ3: cursor: 
 value:  + i + 
 =  + calendarCursor.getString(i));
                                                 break;
                                         case Cursor.FIELD_TYPE_INTEGER:
                                                 Log.i(TAG, QQQ3: cursor: 
 value:  + i + 
 =  + calendarCursor.getInt(i));
                                                 break;
                                         case Cursor.FIELD_TYPE_FLOAT:
                                                 Log.i(TAG, QQQ3: cursor: 
 value:  + i + 
 =  + calendarCursor.getFloat(i));
                                                 break;

                                         }

                         

[android-developers] Re: Fwd: Android Calendar to sync after adding events programmatically

2011-11-03 Thread Michael Chan
Hi David,

If your customer imports the events to Google Calendar, it is a one
time copy. It will never refresh.  He/she should add by url instead.
See http://www.google.com/support/calendar/bin/answer.py?answer=37100

If it refreshes on the web calendar, it should automatically sync to
the phone.

Let me know if I misunderstood.

Thanks,
Mike

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Fwd: Android Calendar to sync after adding events programmatically

2011-11-03 Thread Michael Chan
Android doesn't have an ics parser right now. You will need to supply that.
Other than that, it should be pretty straight forward to build the app you
want.

On Thu, Nov 3, 2011 at 2:22 PM, David Toledo dtole...@gmail.com wrote:

 Thanks. Exist some way for can make from android code using .ics url


 2011/11/3 Michael Chan mc...@android.com

 Hi David,

 If your customer imports the events to Google Calendar, it is a one
 time copy. It will never refresh.  He/she should add by url instead.
 See http://www.google.com/support/calendar/bin/answer.py?answer=37100

 If it refreshes on the web calendar, it should automatically sync to
 the phone.

 Let me know if I misunderstood.

 Thanks,
 Mike

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Fwd: Android Calendar to sync after adding events programmatically

2011-10-28 Thread Michael Chan
Hi David,

If you add events programmatically, it should be sync'ed
automatically.

Can you give me a bit of context as what you are trying to do?  Are
you asking about forcing a sync when sync is disabled? Or are you
writing a sync adapter and need to know when something changes?

Thanks,
Mike

On Oct 28, 9:37 am, David Toledo dtole...@gmail.com wrote:
 Hi All

 is possible that some trigger in Android Calendar  can  be to sync new
 events after adding events programmatically.

 Thanks
 David

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: No luck with new ICS CalenderContract

2011-10-25 Thread Michael Chan
Hi Zsolt,

Your URI is content://com.android.calendar and it should be
content://com.android.calendar/calendar.
Can you try CalendarContract.Calendars.CONTENT_URI instead of
CalendarContract.CONTENT_URI?

Thanks,
Mike

On Oct 23, 11:57 pm, Zsolt Vasvari zvasv...@gmail.com wrote:
 I am trying to convert my Calendar code to the new ICS APIs.

 For starters, I am trying the simplest possible operation -- reading
 the list of Calendars.

 I am using the following code:

 context.getContentResolver().query(CalendarContract.CONTENT_URI,
 CALENDARS_PROJECTION, CALENDARS_WHERE, null,
 CalendarContract.Calendars.DEFAULT_SORT_ORDER)

 but I am getting an unknown URL exception on the ICS emulator, both
 Standard and Google API images:

 E/ACRA    (  746): Caused by: java.lang.IllegalArgumentException:
 Unknown URL content://com.android.calendar
 E/ACRA    (  746):      at
 android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:
 165)
 E/ACRA    (  746):      at
 android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:
 135)
 E/ACRA    (  746):      at
 android.content.ContentProviderProxy.query(ContentProviderNative.java:
 358)
 E/ACRA    (  746):      at
 android.content.ContentResolver.query(ContentResolver.java:304)

 Is this supposed to work on the emulator?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: No luck with new ICS CalenderContract

2011-10-25 Thread Michael Chan
Hi Zsolt,

Can you try CalendarContract.Calendars.CONTENT_URI instead of
CalendarContract.CONTENT_URI?

Thanks,
Mike

On Oct 24, 5:39 pm, Zsolt Vasvari zvasv...@gmail.com wrote:
 I would have expected to work, also.

 It's kind of frustrating that the first time we are goig to be able
 put out fires, is when the general public will get hold of the first
 ICS device.  The emulator is all but useless.

 On Oct 25, 12:25 am, Mark Murphy mmur...@commonsware.com wrote:







  I haven't had a chance to yet, and probably won't for a few weeks.
  Since the Calendar app is in the emulator, I would have expected that
  content provider to work. It's possible that it is an emulator bug --
  without hardware as a point of reference, it is difficult to tell.

  On Mon, Oct 24, 2011 at 10:19 AM, Zsolt Vasvari zvasv...@gmail.com wrote:
   Nobody tried this new API yet?

   On Oct 24, 2:57 pm, Zsolt Vasvari zvasv...@gmail.com wrote:
   I am trying to convert my Calendar code to the new ICS APIs.

   For starters, I am trying the simplest possible operation -- reading
   the list of Calendars.

   I am using the following code:

   context.getContentResolver().query(CalendarContract.CONTENT_URI,
   CALENDARS_PROJECTION, CALENDARS_WHERE, null,
   CalendarContract.Calendars.DEFAULT_SORT_ORDER)

   but I am getting an unknown URL exception on the ICS emulator, both
   Standard and Google API images:

   E/ACRA    (  746): Caused by: java.lang.IllegalArgumentException:
   Unknown URL content://com.android.calendar
   E/ACRA    (  746):      at
   android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:
   165)
   E/ACRA    (  746):      at
   android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:
   135)
   E/ACRA    (  746):      at
   android.content.ContentProviderProxy.query(ContentProviderNative.java:
   358)
   E/ACRA    (  746):      at
   android.content.ContentResolver.query(ContentResolver.java:304)

   Is this supposed to work on the emulator?

   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en

  --
  Mark Murphy (a Commons 
  Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

  Warescription: Three Android Books, Plus Updates, One Low Price!- Hide 
  quoted text -

  - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] [Android Development] Can i use MapView and ListView in the same screen ?

2011-06-27 Thread hei chan
Hi All,

I am new android developer.
I want to do a screen including Map, List, Text.

Layouts like this:
Layouts
   Some Text here.
   MapView /MapView
   ListView/ListView
/Layouts

As i known, using MapView should extends MapActivity and using
ListView should extends ListActivity.
Can i combine two Activities into one?
Is it possible to do it?

Thanks,
Hei

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Impact on existing app if I changed my Developer Name

2011-04-20 Thread Ryan Chan
I can edit my Developer Name, but what will be the impact on
existing app if I changed this value?

Also be changed?

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] hey if you get the 32 bit errorhey if you get the 32 bit error

2011-02-03 Thread A Chan
when you're trying to upload your app make sure that the line for the
min version number is not enclosed in another tag.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Got 12 Google Wave invitations to use, let me know if you need

2009-11-09 Thread Vincent Chan
Hi,send me one.Thanks!
Vincent Chan


On Tue, Nov 10, 2009 at 00:12, dave dayong...@gmail.com wrote:

 Hi all,

 I just got 12 Google Wave invitations to use, please let me know if
 you need one.

 Cheers.

 Dave

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] merge images

2009-09-15 Thread chan

can you give some sample codes for merge several images into a one
single image..
Thank you advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android 1.6 SDK is here!

2009-09-15 Thread Vincent Chan
[?]
Vincent Chan


On Wed, Sep 16, 2009 at 10:18, Xavier Ducrohet x...@android.com wrote:


 A last minute mix-up had us upload the wrong SDK packages :(

 The only difference is the lack of TTS language files and of the
 Accessibility apps (TalkBack, SoundBack and KickBack)

 If you don't care about this you can keep using your 1.6 SDK. If you
 care about these features, I've just uploaded the correct archives.

 We apologize for the inconvenience.

 Xav

 On Tue, Sep 15, 2009 at 3:22 PM, Xavier Ducrohet x...@android.com wrote:
 
 http://android-developers.blogspot.com/2009/09/android-16-sdk-is-here.html
 
  Enjoy!
  --
  Xavier Ducrohet
  Android Developer Tools Engineer
  Google Inc.
 



 --
 Xavier Ducrohet
 Android Developer Tools Engineer
 Google Inc.

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---

inline: 328.png

[android-developers] Re: Android 2d Shooter Game AirAttack Follow My Blog!

2009-05-09 Thread Vincent Chan
Open Source?

Vincent Chan


On Sun, May 10, 2009 at 03:06, TjerkW tje...@gmail.com wrote:


 Hello Everybody!

 For anyone that is interested in following the development of my
 Android Game: AirAttack,
 i have started a blog where you can follow the development:

 http://airattackandroid.wordpress.com

 So if you are interested, check it out!
 You can also follow me on twitter:
 http://www.twitter.com/tjerkw

 Greetings!
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] port openRecordStore from J2ME to android

2009-04-27 Thread Tony Chan
which class I should be using to do that?
Thanks
Tony

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How could add a new src folder into android src for compiling?

2009-04-09 Thread Vincent Chan
You could do this very easily in eclipse.
Just go to the project properties and choose java build path view.In the
source tab add a folder that you want to set as souce folder.
Is zte developing android phones?
I come from china ,too.

Vincent Chan


On Thu, Apr 9, 2009 at 4:17 PM, chengli chen.l...@zte.com.cn wrote:


 I want to add a new src folder to android project,but there are so
 many file android.mk,so are my src folder.I have no ideas how these
 makefiles are connected with each other while compiling, how could I
 do ?
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: why I can't access http://developer.android.com

2009-03-27 Thread Eric Chan
If you being China Mainland , it is blocked.

Best Regards

Eric Chan


2009/3/27 hu.fu-...@iac.com.tw

 I met this problem too.

 -Original Message-
 From: android-developers@googlegroups.com [mailto:
 android-develop...@googlegroups.com] On Behalf Of kingfu
 Sent: Friday, March 27, 2009 2:09 PM
 To: Android Developers
 Subject: [android-developers] why I can't access
 http://developer.android.com


 Now I am in China.


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: StartActivity in a LinearLayout object

2009-03-27 Thread Eric Chan
Remove  or put super.onActivityResult(requestCode, resultCode, data);
after  add
if (resultCode == RESULT_OK)

int Result_ok =0

Best Regards

Eric Chan


On Fri, Mar 27, 2009 at 1:27 PM, xuxiake2...@gmail.com 
xuxiake2...@gmail.com wrote:


 I want to start a new activity in  a sub class   of LinearLayout when
 it was clicked and then using onActivityResult to receive result when
 the new activity finished, just like this


 ---
 public class LinearLayoutA extends LinearLayout  {
 .
@Override
protected void onFinishInflate() {
super.onFinishInflate();

   this.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(getContext(),
 SomeActivity.class);
   getContext().startActivity(intent)  ;
 // can't  usegetContext().
 startActivityForResult here
  }
 });
 }
 }

 ---

 public class ActivityA extends Activity {
 ..
  @Override
protected void onActivityResult(int requestCode, int resultCode,
 Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (rdata!= null) {
  ..

 }
}

 }



 ---
 but , onActivityResult never br called. why?
 what should i do ?
 any one can help me ?

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Cupcake Emulator do not mount SD card image

2009-03-26 Thread Eric Chan
I met the same question
Best Regards

Eric Chan


On Wed, Mar 25, 2009 at 3:57 PM, Victor vkrugli...@gmail.com wrote:


 I just download a cupcake branch of source code and build it.
 I configured Eclipse for a new SDK, and appear the things is works
 great, EXCEPT emulator.
 1. I configured a new AVD as parameter i pointed my old sdcard.img
 then loaded and do not see my sdcard
 2. then I back and configure another AVD with a parameter to create a
 new sdcard.img, when the emulator loaded I still not seen sdcard in
 emulator.
 3. then I try to something like: emulator -avd myavd -sdcard
 mysdcard.img and there is still no sd card.

 How can I restore my sd card in emulator.

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to setup the DNS to access the external nework

2009-03-25 Thread Eric Chan
Push a Ipconfig file to you phone or emulator
Best Regards

Eric Chan


On Wed, Mar 25, 2009 at 4:00 PM, lianwei Wang lianwei.w...@gmail.comwrote:

 More info, It can access the external network with IP address.


 2009/3/25 lianwei lianwei.w...@gmail.com

 Hi all,

 I can not access the external network because of DNS problem, below is
 my steps:

 1. Setup DNS
 ./adb shell setprop net.dns1 xx.xx.xx.xx

  I can successful access the internal network withou setting the
 http_proxy, such as my.mycomany.com

 2. Setup proxy
  Setup the http_proxy environment variable on the host, and setup the
 dns server in Android.

  Access the external network in browser, such as www.google.com. It
 report Web page not available, the log of logcat say that:
I/InetAddress(  187): Unknown host www.google.com, throwing
 UnknownHostException
E/browser (  187): onReceivedError code:-2 The URL could not be
 found.

  Setting the http_proxy in sqlite3 /data/data/
 com.android.providers.settings/databases/settings.db also does not
 work.

  I guess it is the dns issue. But strange that the DNS can work for
 internal network, but can not work for external network.

 Does anyone know how to fix this issue?

 Thanks,
 Lianwei



 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Null pointer exception in MapActivity

2009-03-13 Thread Eric Chan
check the Manifest file
Best Regards

Eric Chan


On Fri, Mar 13, 2009 at 3:48 PM, olko y.olkho...@gmail.com wrote:


 I am using a procedure described here:

 http://developer.android.com/guide/tutorials/views/hello-mapview.html
 http://androidguys.com/?p=1413

 http://groups.google.com/group/android-developers/browse_thread/thread/fe23998c189ebcbd/38bab7cdd70598f7?lnk=gstq=getOverlays#38bab7cdd70598f7

 to create am instance of MapActivity and put on the map
 zoom controls, my location overlay and a number of subclassed itemized
 overlays.

 Everything seems to work except one little problem.
 As soon as I put subclassed itemized overlayes on the map
 and click the map instead of  the zoom controls I get Null pointer
 exception.

 Any ideas?





 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Adding features to email client

2009-03-09 Thread Eric Chan
you can modified the source of android and rebuild system image, I had done
to email.

Best Regards

Eric Chan


On Mon, Mar 9, 2009 at 6:09 PM, Miguel Paraz mpa...@gmail.com wrote:


 On Mar 6, 6:39 am, My3 maithri...@gmail.com wrote:
  I just wanted to know,whether is it possible to Add extra menu items
  to Standard email client?
  I know that we can use the email client to compose/forward mails, as
  well as we can access the content.
  Was just wondering if we can add extra menu items along with the
  existing menu items.

 No, it's not possible to add extra menu items to other application
 menus.

 For the email client, you might want to work on the k9mail client
 instead.
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Will it work if I setListViewAdapter dynamically?

2009-03-04 Thread Eric Chan
just need refresh list
Best Regards

Eric Chan


On Wed, Mar 4, 2009 at 4:45 PM, Romain Guy romain...@google.com wrote:


 It will work :)

 On Wed, Mar 4, 2009 at 12:39 AM, olko y.olkho...@gmail.com wrote:
 
  I am trying to change ListView adapter on the  fly like this (the
  AdapterMain* extends BaseAdapter):
 
 if(main_view) {
 setListAdapter(new
 AdapterMain(app_context));
 }
 else {
 setListAdapter(new
 AdapterMainDetails(app_context));
 }
 
  Should I do other things or this would be enough?
  
 



 --
 Romain Guy
 Android framework engineer
 romain...@android.com

 Note: please don't send private questions to me, as I don't have time
 to provide private support.  All such questions should be posted on
 public forums, where I and others can see and answer them

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: SSL certificate bypassing for DigiCert

2009-02-06 Thread Eric Chan
I met the same problem as you, if any solution please let me know?


Best Regards

Eric Chan

On Fri, Jan 9, 2009 at 1:17 AM, NitroDesk gsuku...@gmail.com wrote:


 Hello,
 We have pulled a lot of hair out for this one.

 We use the DefaultHttpClient to connect with exchange servers. In
 order to get past sites with self issued certs, we save the cert in a
 file, then when connecting, we get the keystore, add the saved
 certificate to the keystore as a TrustedCertificateEntry. This works
 for all self-certified sites, and most other sites which dont have
 their roots in the trusted list.

 BUT with Digicert issued certificates, doing this still causes the no
 trusted certificate error.
 I was wondering if anyone else had this problem, or if the Android
 group is even aware of this.
 Note that we HAVE to use DefaultHttpClient, and using the other
 classes is not something we are able to do.

 Even adding all the certs in the chain to the keystore does not seem
 to help.

 thanks and regards
 -g
 



-- 
Best Regards

Eric Chan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Debugging applications with Google MAP api on an actual device

2009-02-06 Thread Eric Chan
I met the same problem with you, pls let me know if you got the answer.

*
*
On Fri, Dec 5, 2008 at 3:20 AM, BobW b...@whelanhome.com wrote:


 When I run my map application in the debugger, I can see the map on
 the emulator (I have a MAP key for my debugger from Google), but I
 can't see it from my actual device.
 I can get a release key from Google, and sign a apk with my
 certificate, but I am not sure how to install it on the device or how
 to debug the application on the actual device.

 Any advice would be appreciated.

 Thanks

 



-- 
Best Regards

Eric Chan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Tab Issue:

2008-12-24 Thread Eric Chan
public class MyTabActivityextends TabActivity
{
 @Override
 protected void onCreate(Bundle savedInstanceState)
 {
super.onCreate(savedInstanceState);

TabHost tabs =getTabHost();

tabs.addTab(tabs.newTabSpec(First Tab)
.setIndicator(First Tab)
.setContent(new Intent(this, FirstTab.class)));

tabs.addTab(tabs.newTabSpec(Second Tab)
.setIndicator(Second Tab)
.setContent(new Intent(this, SecondTab.class)));

 }


}


2008/12/23 diya blore diya.bl...@gmail.com

 Hi.
 I want to implement tabs without using xml..
 Please can any one guide me.


 --
 Thank's in adv.
 Diya :)

 



-- 
Best Regards

Eric Chan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to assign a hotkey to an application

2008-12-18 Thread Eric Chan
set short key:)
2008/11/24 ram nath ramyn...@gmail.com


 Hi ,

 How to assign a hotkey to an application so that the application will
 start running on press of that key.

 Regards,
 Ramanadh

 



-- 
Best Regards

Eric Chan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Vertical tabs

2008-12-17 Thread Eric Chan
I have the same problem. but it seems the tabsview derived from framelayout
,can not be set as linearlayout

2008/11/27 Guillaume Perrot guillaume.p...@gmail.com


 I have the same problem.
 Vertical tabs would be great.
 Vertical Gallery would also be neat.
 Especially in landscape mode, a vertical version of these widgets
 could be extremely useful to improve layout space.

 On Oct 16, 12:09 am, Rohit Mordani mord...@gmail.com wrote:
  I have the following layout fortabs:
 
  ?xml version=1.0 encoding=utf-8?
  LinearLayout xmlns:android=http://schemas.android.com/apk/res/
  android
  android:layout_width=fill_parent
  android:layout_height=fill_parent
 android:orientation=horizontal
  TabHost android:id=@+id/TabHost01
  android:layout_width=wrap_content
  android:layout_height=wrap_content
  TabWidget android:layout_width=wrap_content
  android:layout_height=wrap_content
 android:id=@android:id/tabs
  android:orientation=vertical
  /TabWidget
  FrameLayout android:layout_width=wrap_content
  android:layout_height=wrap_content
 android:id=@android:id/
  tabcontent
  TextView android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:id=@+id/TempContent
  /TextView
  /FrameLayout
  /TabHost
  /LinearLayout
 
  Even though I set the orientation toverticalon the tabwidget, I
  still get horizontaltabs. Is there a way to make thetabsvertical
  (one below the other instead of side by side) ?
 
  Rohit
 



-- 
Best Regards

Eric Chan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How can I send CJK text via SMS on G1

2008-12-16 Thread Eric Chan
Jay :

you need to add CJK font support in your G1

2008/12/16 hex hexuzh...@gmail.com


 It's very interesting for me too.  :)

 On 12月9日, 上午2时55分, pusher toytro...@gmail.com wrote:
  Yes. It's very interesting for me too.
 



-- 
Best Regards

Eric Chan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Background setting problem

2008-12-16 Thread Eric Chan
ok, which view you wannt to add backgrould, try setbackground

2008/12/16 diya blore diya.bl...@gmail.com

 Hi All,
 i wan to set image as background through my project.. ?how can it be
 achieved? Guide me..
 --
 Thank's in adv.
 Diya :)

 



-- 
Best Regards

Eric Chan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Can we write Android code in C++

2008-12-16 Thread Eric Chan
of course, you can , before that, you should know how interoperation between
Java and C

2008/12/16 gaso...@gmail.com gaso...@gmail.com


 A guy (who implement chinese IME) from www.dotphone.org said they will
 release a C/C++ dev toolkit (NOT from Google) in a few week, let's
 see.

 The original post is in chinese.
 http://www.androidin.com/bbs/viewthread.php?tid=2851extra=page%3D1page=1

 --
 Fred
 



-- 
Best Regards

Eric Chan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Background setting problem

2008-12-16 Thread Eric Chan
you can overrite theme setbackground,  overrite layout, and use the new
layout for you project

2008/12/16 diya blore diya.bl...@gmail.com

 Its like theme.. it must be through project.. i had set in

 AbsoluteLayout absLayout =
 *new* AbsoluteLayout(MainActivity.*activityinstance*);

 MainActivity.
 *activityinstance*.setContentView(absLayout);
 absLayout.setBackgroundResource(R.drawable.*background*);
 this my code.. it work for first two pages...in 3 page in using
 linearlayout..
 in that pages.. it take white default as background.. how should i carry
 that theme through my project...


 On Tue, Dec 16, 2008 at 3:41 AM, Eric Chan jude...@gmail.com wrote:

 ok, which view you wannt to add backgrould, try setbackground

 2008/12/16 diya blore diya.bl...@gmail.com

  Hi All,
 i wan to set image as background through my project.. ?how can it be
 achieved? Guide me..
 --
 Thank's in adv.
 Diya :)





 --
 Best Regards

 Eric Chan




 --
 Thank's in adv.
 Diya :)

 



-- 
Best Regards

Eric Chan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Question about the use of FrameLayout

2008-12-16 Thread Eric Chan
 state and when not.
 
So there are certainly situations where it makes sense to switch
 between
views in an activity: heck, there is sample code for this such as
 in the tab
demos.  A good general rule of thumb is that if the user is
 navigating to
what they perceive to be a new screen, it should be expressed as an
activity, and if they are switching between related views in the
 same screen
is can often make sense to do that all in one activity.
 
On Tue, Dec 16, 2008 at 9:50 AM, loty lev.pert...@gmail.com
 wrote:
 
I'm actually on the same page with Mark. To me Android's history
mechanism is more of a hassle than a benefit especially if you use
view=activity anathema. Personally I found that views inflating is
 not
that slow at all. I didn't measure memory footprint of my
 applications
but Hey, let Android swap some other application out if my app
 needs
more RAM :) At least I won't have to bother with endless
 activities
nightmare.
Perhaps I should look into FrameLayout more closely.
 
On Dec 16, 12:14 pm, Romain Guy romain...@google.com wrote:
 Such an approach would be very inefficient for several reasons.
 First
 of all it requires to inflate many resources that won't be
 needed
 right away, which will slow down your application startup time.
 It
 will also increase memory usage. Then you will defeat the
 history
 mechanism built in Android, thus forcing you to implement the
 back
 yourself, and everything it entails. It's a lot more work for
 you, and
 you will probably end up having a user experience that feels
 like
 other Android apps but not quite.
 
 What performance issue are you trying to solve?
 
 On Tue, Dec 16, 2008 at 6:01 PM, Mark mark.nuetzm...@gmail.com
 wrote:
 
  Would there be an advantage of using multiple Activity classes
 each
  with their own primary layout as opposed to creating multiple
 layout
  views and stacking them into FrameLayout?  One of the things I
  currently do in my WM development that has worked very well in
 terms
  of performance is to create multiple layers for a form and
 then show
  or hide the layers based on what the user is doing.  I could
 see using
  the FrameLayout class to stack multiple other layouts that
 would
  provide the same capabilities.  This would allow me to use a
 single
  Activity to wrap what I need rather than creating multiple
 Activities.
 
  thanks,
  Mark
 
 --
 Romain Guy
 Android framework engineer
 romain...@android.com
 
 Note: please don't send private questions to me, as I don't have
 time
 to provide private support.  All such questions should be posted
 on
 public forums, where I and others can see and answer them
 
--
Dianne Hackborn
Android framework engineer
hack...@android.com
 
Note: please don't send private questions to me, as I don't have
 time to
provide private support.  All such questions should be posted on
 public
forums, where I and others can see and answer them.
 
   --
   Romain Guy
   Android framework engineer
   romain...@android.com
 
   Note: please don't send private questions to me, as I don't have time
   to provide private support.  All such questions should be posted on
   public forums, where I and others can see and answer them
 
  --
  Romain Guy
  Android framework engineer
  romain...@android.com
 
  Note: please don't send private questions to me, as I don't have time
  to provide private support.  All such questions should be posted on
  public forums, where I and others can see and answer them




 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com


 Note: please don't send private questions to me, as I don't have time to
 provide private support.  All such questions should be posted on public
 forums, where I and others can see and answer them.


 



-- 
Best Regards

Eric Chan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: hiding the title bar

2008-12-16 Thread Eric Chan
Can you make me known which one is fullscreen?

2008/12/17 Dianne Hackborn hack...@android.com

 You could look at ApiDemos.

 On Tue, Dec 16, 2008 at 1:11 PM, Jason Proctor ja...@redfish.net wrote:


 This works fine, when called in onCreate() of an activity:
 
 getWindow().requestFeature(Window.FEATURE_NO_TITLE);
 
 Or, as Andrew Stadler pointed out, you can use this in your activity in
 your manifest:
 
 android:theme=@android:style/Theme.NoTitleBar
 
 Note that these remove the title bar. They do not remove the status bar
 (where the signal strength and battery level indicators lie).

 thanks for the response.

 is there a way to go really fullscreen?

 the reason i ask is that on the G1, the camera preview is always the
 wrong orientation. in portrait, the preview appears landscape, and
 vice versa. in order to incorporate this rather inconvenient
 feature seamlessly into my app, i have the preview activity go into
 landscape mode, which gives the effect of a preview at the same
 orientation. unfortunately the presence of the bars ruins the
 illusion.

 thanks for any help with this,
 j






 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support.  All such questions should be posted on public
 forums, where I and others can see and answer them.



 



-- 
Best Regards

Eric Chan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: TabHost and New Activities

2008-12-15 Thread Eric Chan
=fill_parent
  android:layout_height=wrap_content
  android:text=Second tab
  /
  /LinearLayout
 
  and here is row.xml
 
  ?xml version=1.0 encoding=utf-8?
  LinearLayout xmlns:android=http://schemas.android.com/apk/res/
  android
  android:layout_width=fill_parent
  android:layout_height=wrap_content
  android:orientation=vertical
 
  TextView
  android:id=@+id/label
  android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:textSize=44sp
  /
  TextView
  android:id=@+id/information
  android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:textSize=20sp
  android:text=life..
  /
  /LinearLayout
 
  I must have missing something here...can anyone please help?
 
  Thanks.
  --
  Lawrence Samantha
 
  On Nov 23, 3:52 pm, g1bb corymgibb...@gmail.com wrote:
 
   Eureka!
 
   I got this to work by taking a look at this sample project:
 http://www.mail-archive.com/android-developers@googlegroups.com/msg06...
 
   Set my class that extends TabActivity as the main layout.
 
   Thanks again Mark for your help.
 
   On Nov 23, 12:45 pm, g1bb corymgibb...@gmail.com wrote:
 
Hi Mark,
 
My question now is, now that I have the subclass created, how do I
create the tabs using _it_, instead of how I was doing it before via
the code in my first post?
 
Thanks again for your help.
 
On Nov 23, 12:23 pm, Mark Murphy mmur...@commonsware.com wrote:
 
 g1bb wrote:
  I have no problem with that at all. I found this API demo:
 
 http://code.google.com/android/samples/ApiDemos/src/com/example/andro...
 
  Which is exactly what I want, but now I'm having a hard time
 deriving
  from that subclass. Is there an example anywhere of how to do
 this?
 
 I guess I don't understand the question. That API demo shows how to
 subclass TabActivity, as do the Tabs1 and Tabs2 demos (same URL,
 change
 the number).
 
 What specifically are you having problems with?
 
 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 
 Android Training on the Ranch! -- Mar 16-20, 2009
 http://www.bignerdranch.com/schedule.shtml
 



-- 
Best Regards

Eric Chan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to integrate c code with java code

2008-12-02 Thread Eric Chan
To Amit :

To interaction between C and Java maybe a little complicate, you can do it
follows this:

*Because each class loader maintains a set of native libraries, the
programmer may use a single library to store all the native methods needed
by any number of classes as long as those classes have the same defining
loader. *

*Native libraries will automatically be unloaded by the virtual machine when
their corresponding class loaders are garbage collected.*



it a example

JNIEXPORT jstring JNICALL Java_Prompt_getLine
(JNIEnv *env, jobject obj, jstring prompt)
{
char buf[128];
  const char *str = (*env)-GetStringUTFChars(env, prompt, 0);
   printf(%s, str);
  (*env)-ReleaseStringUTFChars(env, prompt, str);

}
I just writed a document about this, but sorry it is a Chinese version, i
will post it after tranlate to English

2008/12/2 Amit [EMAIL PROTECTED]


 Android supports JNI at application framework level.
 For example, in platform/frameworks/base.git, Mediaplayer.java at:

 http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=media/java/android/media/MediaPlayer.java;h=b6064e1bb6b0f40f72fc1535b264f5c3fa190548;hb=HEAD
 file has got some native function calls
 And these native function calls must be implemented in either
 libmedia_jni.so or media_jni.dll
 but i'm unable to located either of the files in the source code. plz
 tell me the path if they are present in the source code.

 i found a c++ file android_media_MediaPlayer.cpp at:

 http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=media/jni/android_media_MediaPlayer.cpp;h=f9f3646f0c308bf19bb3c3af02fc0e0e4260afbd;hb=HEAD
 that implements the corresponding native functions,
 but coudnt find how it calls the actual c/c++ libraries. Also, it
 includes files media/mediaplayer.h which i coudnt find.
 This must be the file generated by java file using javah.

 It also included files JNIHelp.h and android_runtime/AndroidRuntime.h
 which are also untraceable.
 Plz help me in this problem.

 Thanks
 Amit

 On Dec 1, 2:07 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:
  Hi Amit,
 
  DigitalAirways (www.digitalairways.com) does this to allow all the
  Kaleido applications to run on Android with great performances and
  very limited porting effort.
 
  Franck
 
  On Nov 28, 11:00 am, Amit [EMAIL PROTECTED] wrote:
 
 
 
   Hello friends,
 
   Can u plz tell that if i want to write some piece of code for android
   in c or c++, how can i integrate the code with java code.
 
   Any help appreciated
 
   Thanks
   Amit- Hide quoted text -
 
  - Show quoted text -
 



-- 
Best Regards

Eric Chan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---