Re: [android-developers] Using Service without startService(), bindService()?

2012-11-01 Thread Kristopher Micinski
Ah, good..  I had simply assumed that was a commonish pattern I had never
read about, but it makes sense... (I don't actually do much app writing
these days..)

kris

On Thu, Nov 1, 2012 at 1:27 AM, Nikolay Elenkov
nikolay.elen...@gmail.comwrote:

 On Thu, Nov 1, 2012 at 2:21 PM, Kristopher Micinski
 krismicin...@gmail.com wrote:

 
  Slightly odd and nonstandard use of a Service to organize the app design,
  but still useful.
 

 This has been reported ages ago without an answer:

 http://code.google.com/p/marketbilling/issues/detail?id=8

 Last answer is the most useful, I think.

 --
 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] Audio Play

2012-11-01 Thread TreKing
On Thu, Nov 1, 2012 at 12:23 AM, Sadhna Upadhyay
sadhna.braah...@gmail.comwrote:

 Hi everybody i am playing a audio o button click then it is playin twice
 on single click why it is happening,i dont know please help me if any one
 of you know the reason.


Read http://www.catb.org/esr/faqs/smart-questions.html, then try again.

-
TreKing http://sites.google.com/site/rezmobileapps/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

[android-developers] Update Gallery to load all images

2012-11-01 Thread shiva pendem
Hi

i am opening Gallery as intent in my application after saving a image in 
the application

here is the code to open the Gallery to intent


Intent intent = new Intent();
  intent.setType(image/*);
  intent.setAction(Intent.ACTION_GET_CONTENT);
  startActivityForResult(Intent.createChooser(intent, Select 
Picture),101);

But i notice that the Gallery is not loading all the images (The images 
that are saved Recently), 

Can any one suggest me the way so that the Gallery updates all the images 
and show them in the gallery

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] Re: Audio Play

2012-11-01 Thread shiva pendem
Hi,

Even i have faced the issue,

The mail problem is that the instance which you press will compulsorily 
create two instances, They are MotionEvent.ACTION_DOWN and 
MotionEvent.ACTION_MOVE, So to over come this you add a condition as 
follows 

public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
if(event.getAction() == MotionEvent.ACTION_DOWN){
  //start player
return true;
}

On Thursday, November 1, 2012 10:55:21 AM UTC+5:30, Sadhna Upadhyay wrote:

  Hi everybody i am playing a audio o button click then it is playin twice 
 on single click why it is happening,i dont know please help me if any one 
 of you know the reason.



All the best
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] Re: Barcode Scanner app

2012-11-01 Thread Karl Kristian Markman
You will find all you need here:
http://code.google.com/p/zxing/

and here is integration explained
http://stackoverflow.com/questions/2050263/using-zxing-to-create-an-android-barcode-scanning-app


On Thursday, November 1, 2012 6:30:39 AM UTC+1, askl wrote:

 Thank you.
 Can you send me the sample project..

 On Thursday, November 1, 2012 9:48:59 AM UTC+5:30, askl wrote:

 *Please give me some option.*
 *How to develop a barcode scanner app.*



-- 
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: Barcode Scanner app

2012-11-01 Thread dEEPESH PPM
Please reffer this link:
 http://sourceforge.net/projects/zbar/files/AndroidSDK/
Deepesh

On Thu, Nov 1, 2012 at 12:50 PM, Karl Kristian Markman
karlkristian.mark...@gmail.com wrote:
 You will find all you need here:
 http://code.google.com/p/zxing/

 and here is integration explained
 http://stackoverflow.com/questions/2050263/using-zxing-to-create-an-android-barcode-scanning-app



 On Thursday, November 1, 2012 6:30:39 AM UTC+1, askl wrote:

 Thank you.
 Can you send me the sample project..

 On Thursday, November 1, 2012 9:48:59 AM UTC+5:30, askl wrote:

 Please give me some option.
 How to develop a barcode scanner app.

 --
 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 set margin in Dialog

2012-11-01 Thread Dilip Kumar Chaudhary
I have used Dialog for display ad in my Andorid app.But I have to display
this Dialog about 50dp top from buttom so i think we should set
DialogGravity buttom and set its buttom margine 50dp.But i'm unable to
use margin
in Dialog.so please can suggest me how to solve this. I have posted this on
stackoverflowhttp://stackoverflow.com/questions/13172276/how-to-set-margin-in-dialog/13172519#13172519

-- 
*Thanks  Regards*
Dilip Kumar Chaudhary
My Linkedin Profilehttp://in.linkedin.com/pub/dilip-kumar-chaudhary/44/64/55b
My Development Blog http://dilipdevelopment.blogspot.com/

-- 
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] Buttons in ViewPager pages: Problem swiping/dragging pages when finger starts on top of Button. How can I fix this?

2012-11-01 Thread Piren
That is funny :-)

Glad i could help.

On Thursday, November 1, 2012 1:32:19 AM UTC+2, Streets Of Boston wrote:

 Update:

 The weird 0x0010 value is the value of *VERY_WIDE*, which is assigned 
 to the Layout's width if the *TextView*'s *mHorizontallyScrolling *field* 
 *is set to *true*. 

 Calling *setHorizontallyScrolling(false)* or setting the *
 android:scrollHorizontally=false* attribute in your XML does the trick 
 as well :-)

 On Wednesday, October 31, 2012 7:11:33 PM UTC-4, Streets Of Boston wrote:

 Thanks Piren! 

 Your answer led me into the right direction.

 This was the problem:

 The *ViewPager *contains *TextViews *as (grand-grand...) children. 
 Before it actually starts scrolling it asks if the touched child (or one of 
 the child's children) could scroll horizontally. If one of them does, the 
 *ViewPager* won't scroll horizontally itself. Instead, it lets this 
 child scroll.

 The *TextView* implements a method called '*canScrollHorizontally(int)*'. 
 It uses the *mLayout *member to determine this method's return value. 
 Sometimes, the *mLayout.mWidth*  is 0x0010 (= 1048576) and this 
 weird value causes this *canScrollHorizontallly *method to incorrectly 
 return *true *(instead of *false*).

 The method canScrollHorizontally is only available for API-level 14 or 
 up... this may explain the issue...

 For now, I just subclass my *TextView* that appear in the *ViewPager *and 
 override the *canScrollHorizontally *method, because I know the text in 
 these *TextViews *can never scroll horizontally. 

 public class MyTextView extends TextView {
 ...
 @Override
 public boolean canScrollHorizontally(int direction) {
 return false;
 }
 
 }

 On Wednesday, October 10, 2012 9:38:03 AM UTC-4, Piren wrote:

 The thing is that being Clickable shouldn't have any impact in this 
 scenario. Although a clickable view always consumes the touch event, in 
 ViewPager's case it should intercept it when it recognizes a drag gesture 
 (see its onInterceptTouchEvent implementation).

 You should override onTouch and onInterceptTouchEvent for all your 
 custom views and use logs to see how the events propagate through them (the 
 proper behavior would be the button intercepting onTouch and once your 
 finger moves enough in the X axes it should stop getting that event)

 My best guess is that the ViewPager cancels the drag because it believes 
 your views have horizontal scrolling - I didnt dig all the way through, but 
 it seems to be basing that mostly on child view sizes... since you said you 
 have custom layout logic, i'm thinking it makes the ViewPager return the 
 wrong result. try debugging ViewPager's canScroll method.

 they also have this comment in there:  // TODO: Add versioned support 
 here for transformed views. This will not work for transformed views in 
 Honeycomb+ )Kind of suspicious :)


 On Tuesday, October 9, 2012 11:57:28 PM UTC+2, Streets Of Boston wrote:

 The targetSdk is 11.
 This is our hierarchy:

 -ViewPager 
   | 
   +-NoSaveStateFrameLayout
| 
+-ProfileGridView
   |
   +-ProfileGridViewRow
   |
   +-FrameLayout
 |
 +-TextView

 Note that ProfileGridView contains one or more ProfileGridViewRows 
 which contains one or more clickable TextView  (i.e. our buttons).
 The ProfileGridView and ProfileGridViewRow are custom LinearyLayouts: 
 The have their own measure and layout-logic. These two subclasses don't 
 have any method or logic to capture or handle touch-events.

 Thanks!

 On Tuesday, October 9, 2012 11:31:03 AM UTC-4, Piren wrote:

 ViewPager is part of the support package and inherits from a ViewGroup 
 , it shouldn't matter much which OS version it runs on.
 I have a similar setup and i dont experience this issue (using support 
 package v4, i assume you're using the same since you said you tested on 
 earlier os versions).
 I can even press a button and see it switch to its pressed state and 
 then start a swipe without generating an onClick event.

 What is your targetSdkVersion? 

 On Tuesday, October 9, 2012 4:27:31 PM UTC+2, Streets Of Boston wrote:

 Hi Kostya,

 Thanks for your answer.

 This bug (?) only happens on Jelly Bean (I don't have ICS devices to 
 test it on).
 It works fine on Honeycomb and lower OS versions. 

 It seems there is indeed a regression of the ViewPager in JB (and 
 possibly ICS).

 Thanks.

 On Tuesday, October 2, 2012 12:47:41 PM UTC-4, Kostya Vasilyev wrote:

 Sounds like a bug in how ViewPager dispatches events (sorry for 
 stating the obvious). I'd consider looking at the source and comparing 
 it 
 to ScrollView (which handles nested touchable areas just fine).

 -- K

 2012/10/2 Streets Of Boston flying...@gmail.com

 Hi everyone,

 I have a ViewPager that contains pages, each page with a bunch of 
 Buttons (or clickable TextViews). When I set the buttons to 
 

Re: [android-developers] Re: Audio Play

2012-11-01 Thread Asheesh Arya
refer this link
You can read the full Article
Herehttp://clicks.aweber.com/y/ct/?l=4suhEm=3ggiV05UF5ctSL0b=qJm58qxICDVaIOScLTot0Q

-- 
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.intent.action.HEADSET_PLUG Permission

2012-11-01 Thread Anton Kaiser
Can you tell us why you have to send one of those protected broadcast? I can't 
imagine any scenario. Maybe we will find other ways to achieve your goals. 

-- 
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] Using Service without startService(), bindService()?

2012-11-01 Thread Kostya Vasilyev
Seems like it was just a way to reuse code which sometimes runs inside a
proper service, and sometimes is called from an activity.

-- K

2012/11/1 Kristopher Micinski krismicin...@gmail.com

 Ah, good..  I had simply assumed that was a commonish pattern I had never
 read about, but it makes sense... (I don't actually do much app writing
 these days..)

 kris


 On Thu, Nov 1, 2012 at 1:27 AM, Nikolay Elenkov nikolay.elen...@gmail.com
  wrote:

 On Thu, Nov 1, 2012 at 2:21 PM, Kristopher Micinski
 krismicin...@gmail.com wrote:

 
  Slightly odd and nonstandard use of a Service to organize the app
 design,
  but still useful.
 

 This has been reported ages ago without an answer:

 http://code.google.com/p/marketbilling/issues/detail?id=8

 Last answer is the most useful, I think.

 --
 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] Using facebook android sdk from service

2012-11-01 Thread dmtrl...@gmail.com
  My application has functionality that send some content on server and 
(need) post it on facebook. It uses service for sending (for store data I'm 
use sqlite). Is it possible to handle facebook sessions e.t.c from service? 
I need it because time when content will be stored in DB and sending time 
can be different (may be connection will be lost on very long time and 
sending starts after connection will be available, but only sending service 
of my application will be active in this time). I can't find any solution 
for this case(and good solution will be great). Please help.

-- 
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: Remote resources

2012-11-01 Thread Francisco Marzoa
That's the approach I was talking about on my first message, but it's not
so simple as downloading a file. You must also manage by yourself resource
selection on localized apps, for example. And also resource changes among
different app versions.

It is not very difficult, but if there is something yet done and available
in the SDK -it's likely not- or as third party library, it may not worth
the effort to make something fully new.

Regards,
On Oct 31, 2012 8:53 PM, bob b...@coolfone.comze.com wrote:

 Maybe just have it connect to a web site and download
 http://www.example.com/resources.zip on the first run.  Then unzip that
 to the SD card.  I have seen GLU mobile do some stuff like this, and they
 are legit.



 On Wednesday, October 31, 2012 8:35:11 AM UTC-5, Fran wrote:

 Hi there,

 I have a real problem when providing different resources for different
 displays, according to their density. Putting all the needed graphics on
 the same apk file makes it really big, and most of the graphics will not
 be used by the device where they are installed never.

 I have seen that what some developers does is to have an HD separated
 version of their app, but this implies more development effort and
 dispersing social promotion of the game (user's ratings, position on the
 market, social network links, etc.)

 I think the best approach should be something that keeps the minimal
 needed resources on the apk, and during the first run of the app takes
 care of downloading the ones that fits the display of the device.

 This has some additional difficulties, but I do not want to write a
 thesis on this, just to ask if someones knows something that does this
 yet written, before I start reinventing the wheel for my own projects.

 Best regards,

  --
 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] Open PDF file from assets

2012-11-01 Thread Carlos A. M. dos Santos
On Wed, Oct 31, 2012 at 3:09 AM, Jovish P android.f...@gmail.com wrote:
 When user clicks on a button i want to open the pdf file stored inside our
 application(ie which is inside Assets folder of our app). Open means , to
 view the pdf file using Intent. I don't have any problem in  using third
 party applications to  view pdf file.In the intent i sepcify mimetype , so
 it will list all the pdf viewer installed in his phone. So user can select
 his favorite pdf viewer to view the pdf file which is stored in our
 application

 some-context-instance.getAssets().open(assetName) will return inputstream.
 That is not wht we need. Thanks for this suggestion

I see. So I suggest you to create a content provider and invoke the
third-party app with a corresponding intent (supposing that the viewer
is able to read from a provider, of course). That would be the elegant
and fancy approach.

A not-so-fancy solution is to copy the PDF to the SD card and invoke
the viewer app with a file:// URI. This approach has a disadvantage:
it's hard to know when the copy can be removed because you don't know
when the viewer will stop accessing it.

 I guess now everything is clear. sorry for my bad English.


-- 
The flames are all long gone, but the pain lingers on

-- 
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] Who calls the lifecycle handlers of Activity components?

2012-11-01 Thread Andrew
Dear friends,

I do not know whether this group is a good place to ask this question. But 
I really wish to know who calls the onCreate()... lifecycle handlers of 
Activity components.
By all means, an Android application is not a complete program: no entry 
(main) functions, loosely coupled event handlers... So there must be a part 
in the Android framework for scheduling the invocation of event handlers.

I really appreciate it if someone can provide useful information. This 
question bothers me a lot. 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] Regarding Intents

2012-11-01 Thread krithika rajan
Hi im a newbee to android. im unable to understand android concept.i wnet 
through many sites but i couldnt understand
could u please explain what is Intent,Intent Object and what is the use of 
Intents with clear example.
thanks in 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: Who calls the lifecycle handlers of Activity components?

2012-11-01 Thread Streets Of Boston
Basically, the 'main' of your Java (DalvikVM) sets up a message-queue and a 
looper dispatching these messages on the 'main' (UI) thread. 

Actions by the user or external system events post messages on this queue 
which are then dispatched by the looper to the appropriate objects 
(managers, handlers, etc).

Best thing to do is just create an Activity, override and implement 
onCreate, onStart, etc. and set breakpoints there. Then examine the 
stack-trace in the debugger to figure out what's going on.

On Thursday, November 1, 2012 8:21:41 AM UTC-4, Andrew wrote:

 Dear friends,

 I do not know whether this group is a good place to ask this question. But 
 I really wish to know who calls the onCreate()... lifecycle handlers of 
 Activity components.
 By all means, an Android application is not a complete program: no entry 
 (main) functions, loosely coupled event handlers... So there must be a part 
 in the Android framework for scheduling the invocation of event handlers.

 I really appreciate it if someone can provide useful information. This 
 question bothers me a lot. 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

Re: [android-developers] Are Layouts Reusable?

2012-11-01 Thread Mark Phillips
Thanks, that clears up my confusion.

Mark

On Wed, Oct 31, 2012 at 2:01 PM, nEx.Software
email.nex.softw...@gmail.comwrote:

 You can have many instances of any type of View with the same id without
 restriction. The id is just an int field on a view, so that the view may be
 identified in code. Changes to one instance will not change the other
 instances, regardless of their container (Activity, Fragment, ViewGroup).
 To gain a reference to a particular instance, you should call findViewById
 on its closest parent (assuming you do not have multiple instances as
 direct children of the same parent).

 --
 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: Regarding Intents

2012-11-01 Thread G. Blake Meike
Hey Krithika,

There really are, already, hundreds of these examples out there.  You 
really just need to look around for one.  Marko Gargenta's book, Learning 
Android is slightly out of date, but it certainly explains this concept 
beautifully.  The examples that come with the ADK illustrate the concept, 
thought they don't explain it.

Just have another look around.

G. Blake Meike
Marakana

The second edition of Programming Android is available:
http://shop.oreilly.com/product/0636920023005.do


On Thursday, November 1, 2012 6:12:08 AM UTC-7, krithika rajan wrote:

 Hi im a newbee to android. im unable to understand android concept.i wnet 
 through many sites but i couldnt understand
 could u please explain what is Intent,Intent Object and what is the use of 
 Intents with clear example.
 thanks in 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: How does one use fragment dialogs inside compound controls?

2012-11-01 Thread Satya Komatineni
I couldn't find a reasonable way to solve this. So I did the following
from the compound view

private FragmentManager getFragmentManager()
{
  Context c = getContext();
  if (c instanceof Activity)
  {
 return ((Activity)c).getFragmentManager();
  }
  throw new RuntimeException(Activity context expected instead);
}

Not that it doesn't work. Thought it is a reasonable compromise. Then i can do

public void onClick(View v)
   {
  Button b = (Button)v;
  if (b.getId() == R.id.fromButton)
  {
  DialogFragment newFragment = new
DatePickerFragment(this,R.id.fromButton);
   newFragment.show(getFragmentManager(),
com.androidbook.tags.datePicker);
   return;
  }

  //Otherwise
   DialogFragment newFragment = new DatePickerFragment(this,R.id.toButton);
newFragment.show(getFragmentManager(),
com.androidbook.tags.datePicker);
return;
   }//eof-onclick

Any ways if anyone is looking to see how to do compound controls that
manage their own state and also use fragment dialogs you may want to
look at my attempt at doing this

Principles of Compound Controls: A semi article
http://satyakomatineni.com/item/4341
(principles, sample code, images, and research)

Thanks
Satya

On Tue, Oct 30, 2012 at 3:40 PM, Satya Komatineni
satya.komatin...@gmail.com wrote:
 Examples of fragment dialogs look like this

 SomeActivity
 {
 public void buttonClicked(View someView)
 {
 DialogFragment newFragment = new DatePickerFragment();
 newFragment.show(getFragmentManager(), timePicker);
 }
 public static class DatePickerFragment extends DialogFragment(){  };
 }


 If you have a compound control extending a layout like a linear layout
 how do you isolate this to the view? how do you get a
 fragmentManager from the bowels of a view? or do you pass that to
 the view explicitly?

 Thank you very much for your help
 Satya



-- 
http://satyakomatineni.com/android/training
http://satyakomatineni.com
http://androidbook.com
http://twitter.com/SatyaKomatineni

-- 
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] broken breakpoint

2012-11-01 Thread bob
For some reason, when I put a breakpoint on this line:

BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

it never gets triggered.

Any ideas why?


-- 
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] broken breakpoint

2012-11-01 Thread TreKing
On Thu, Nov 1, 2012 at 10:53 AM, bob b...@coolfone.comze.com wrote:

 For some reason, when I put a breakpoint on this line:

 BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

 it never gets triggered.

 Any ideas why?


You've provided no information about your problem other than a single line
of code that is not special in any way. No one is going to be able to help
you like that. In any case, this would be an Eclipse problem and off topic
for this list.

-
TreKing http://sites.google.com/site/rezmobileapps/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

Re: [android-developers] Open PDF file from assets

2012-11-01 Thread bob
You could always create a 'boot receiver' that deletes the file on next 
boot:   

 receiver android:name=.Boot_Receiver 
intent-filter
action android:name=android.intent.action.BOOT_COMPLETED 

/action
/intent-filter
/receiver



public class Boot_Receiver extends BroadcastReceiver
{

@Override
public void onReceive(Context context, Intent intent)
{
// delete
}

}


On Thursday, November 1, 2012 7:05:55 AM UTC-5, casantos wrote:

 On Wed, Oct 31, 2012 at 3:09 AM, Jovish P androi...@gmail.comjavascript: 
 wrote: 
  When user clicks on a button i want to open the pdf file stored inside 
 our 
  application(ie which is inside Assets folder of our app). Open means , 
 to 
  view the pdf file using Intent. I don't have any problem in  using third 
  party applications to  view pdf file.In the intent i sepcify mimetype , 
 so 
  it will list all the pdf viewer installed in his phone. So user can 
 select 
  his favorite pdf viewer to view the pdf file which is stored in our 
  application 
  
  some-context-instance.getAssets().open(assetName) will return 
 inputstream. 
  That is not wht we need. Thanks for this suggestion 

 I see. So I suggest you to create a content provider and invoke the 
 third-party app with a corresponding intent (supposing that the viewer 
 is able to read from a provider, of course). That would be the elegant 
 and fancy approach. 

 A not-so-fancy solution is to copy the PDF to the SD card and invoke 
 the viewer app with a file:// URI. This approach has a disadvantage: 
 it's hard to know when the copy can be removed because you don't know 
 when the viewer will stop accessing it. 

  I guess now everything is clear. sorry for my bad English. 


 -- 
 The flames are all long gone, but the pain lingers on 


-- 
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 improve image quality in Android Webkit (comparing with iOS)

2012-11-01 Thread huberte
thanks Anthony, may I have a code example please ?



Le mercredi 31 octobre 2012 06:39:24 UTC-4, Anthony Prieur a écrit :

 You might get better results trying to use the Javascript 'viewport'.


 Le mardi 30 octobre 2012 16:24:26 UTC+1, huberte a écrit :

 Trying to load http://www.sciences-physiques.eu/appli/oneimage/ both in 
 iOS and Android (SGS2).

 Image is 1600*2262

 The result is a better image on iOS. I know android can do better, 
 because I had an application with such big image downsized, and the text 
 was clearer.

 I red a lot about adding some code in css, but it seems that it does not 
 apply to webkit

 Here are the screenshots :

 http://tof.canardpc.com/show/9144d047-0aaf-4906-9c96-1a991112f9fc.html

 http://tof.canardpc.com/show/36008198-e6ef-4b02-820b-fe2ca8b8df1c.html

 The code is :

 !DOCTYPE HTMLhtml manifest= lang=en-UShead
 meta charset=UTF-8
 titlecarimage/title
 style type=text/css
  img { width: 100%; }
 html, body {
 height: 100%;
 background-color: #1985D0
 }
 /style
 body
 img src=1.png /
 /body/html

 just that you know, if I put max-width instead of width, the result is worse 
 than with only the width attribute

 Because I'll have physics, chemistry, math and for good rendering I use 
 Latek. So I have to use image. On Android my pupils say I could use 
 something better than a bad scanner. On iOS they say it's like in their 
 books... 

 Thanks a lot !



-- 
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: How to improve image quality in Android Webkit (comparing with iOS)

2012-11-01 Thread Anthony Prieur
Sorry I've no example myself, you would find on the net.


On Thu, Nov 1, 2012 at 8:35 PM, huberte svend.wal...@gmail.com wrote:
 thanks Anthony, may I have a code example please ?



 Le mercredi 31 octobre 2012 06:39:24 UTC-4, Anthony Prieur a écrit :

 You might get better results trying to use the Javascript 'viewport'.


 Le mardi 30 octobre 2012 16:24:26 UTC+1, huberte a écrit :

 Trying to load http://www.sciences-physiques.eu/appli/oneimage/ both in
 iOS and Android (SGS2).

 Image is 1600*2262

 The result is a better image on iOS. I know android can do better,
 because I had an application with such big image downsized, and the text was
 clearer.

 I red a lot about adding some code in css, but it seems that it does not
 apply to webkit

 Here are the screenshots :

 http://tof.canardpc.com/show/9144d047-0aaf-4906-9c96-1a991112f9fc.html

 http://tof.canardpc.com/show/36008198-e6ef-4b02-820b-fe2ca8b8df1c.html

 The code is :

 !DOCTYPE HTML
 html manifest= lang=en-US
 head
 meta charset=UTF-8
 titlecarimage/title
 style type=text/css
  img { width: 100%; }
 html, body {
 height: 100%;
 background-color: #1985D0
 }
 /style
 body

 img src=1.png /

 /body
 /html

 just that you know, if I put max-width instead of width, the result is
 worse than with only the width attribute

 Because I'll have physics, chemistry, math and for good rendering I use
 Latek. So I have to use image. On Android my pupils say I could use
 something better than a bad scanner. On iOS they say it's like in their
 books...

 Thanks a lot !

 --
 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] Creating OpenGL shaders from an alternate class

2012-11-01 Thread Braindrool
Title pretty much says it all. This would be so much easier if I were to 
just use a single class for this. But I have been trying to take advantage 
of Java's class system. To the point I get the Error creating shader.

package com.braindrool.game;


 import android.opengl.GLES20;


 public class Shader {


 public Shader(String vertexShader, String fragmentShader) {

 int vertexShaderHandle = GLES20.glCreateShader(GLES20.GL_VERTEX_SHADER);

 if (vertexShaderHandle != 0) {

 GLES20.glShaderSource(vertexShaderHandle, vertexShader);

 GLES20.glCompileShader(vertexShaderHandle);

 final int[] vertexCompileStatus = new int[1];

 GLES20.glGetShaderiv(vertexShaderHandle, GLES20.GL_COMPILE_STATUS,

 vertexCompileStatus, 0);

 if (vertexCompileStatus[0] == 0) {

 GLES20.glDeleteShader(vertexShaderHandle);

 System.err.println(Deleting vertex shader);

 vertexShaderHandle = 0;

 }

 }

 if (vertexShaderHandle == 0) {

 }

 int fragmentShaderHandle = GLES20

 .glCreateShader(GLES20.GL_FRAGMENT_SHADER);


 if (fragmentShaderHandle != 0) {

 System.out.println(Fragmentshaderhandle success);

 GLES20.glShaderSource(fragmentShaderHandle, fragmentShader);

 GLES20.glCompileShader(fragmentShaderHandle);

 final int[] fragmentCompileStatus = new int[1];

 GLES20.glGetShaderiv(fragmentShaderHandle,

 GLES20.GL_COMPILE_STATUS, fragmentCompileStatus, 0);

 if (fragmentCompileStatus[0] == 0) {

 GLES20.glDeleteShader(fragmentShaderHandle);

 fragmentShaderHandle = 0;

 }

 }


 if (fragmentShaderHandle == 0) {

 System.err.println(Error creating fragment shader.);

 }


 System.out

 .println(linkShaders(vertexShaderHandle, fragmentShaderHandle));

 }


 private int linkShaders(int vertexHandle, int fragmentHandle) {

 int programHandle = GLES20.glCreateProgram();


 if (programHandle != 0) {

 GLES20.glAttachShader(programHandle, vertexHandle);

 GLES20.glAttachShader(programHandle, fragmentHandle);

 GLES20.glBindAttribLocation(programHandle, 0, a_Position);

 GLES20.glBindAttribLocation(programHandle, 1, a_Color);

 GLES20.glLinkProgram(programHandle);

 final int[] linkStatus = new int[1];

 GLES20.glGetProgramiv(programHandle, GLES20.GL_LINK_STATUS,

 linkStatus, 0);

 if (linkStatus[0] == 0) {

 GLES20.glDeleteProgram(programHandle);

 programHandle = 0;

 }

 }


 if (programHandle == 0) {

 System.err.println(Error creating program.);

 }

 return programHandle;

 }

 }



And the call to that function / class:

private void finishLoading() {


 mGLView.queueEvent(new Runnable() {

 public void run() {

 shader = new Shader(asset(shaders/vertex/default),

 asset(shaders/fragment/default));

 }

 });



Questions and help greatly appreciated! 
 

-- 
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: Audio Play

2012-11-01 Thread bob
Be sure to use this approach:

 final Button button = (Button) findViewById(R.id.button_id);
 button.setOnClickListener(new View.OnClickListener() {
 public void onClick(View v) {
 // Perform action on click
 }
 });


On Thursday, November 1, 2012 12:25:21 AM UTC-5, Sadhna Upadhyay wrote:

  Hi everybody i am playing a audio o button click then it is playin twice 
 on single click why it is happening,i dont know please help me if any one 
 of you know the reason.


-- 
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: Creating OpenGL shaders from an alternate class

2012-11-01 Thread bob
 

Sounds like your vertex shader *asset* or fragment shader asset has an 
error in it.

On Thursday, November 1, 2012 4:12:44 PM UTC-5, Braindrool wrote:

 Title pretty much says it all. This would be so much easier if I were to 
 just use a single class for this. But I have been trying to take advantage 
 of Java's class system. To the point I get the Error creating shader.

 package com.braindrool.game;


 import android.opengl.GLES20;


 public class Shader {


 public Shader(String vertexShader, String fragmentShader) {

 int vertexShaderHandle = GLES20.glCreateShader(GLES20.GL_VERTEX_SHADER);

 if (vertexShaderHandle != 0) {

 GLES20.glShaderSource(vertexShaderHandle, vertexShader);

 GLES20.glCompileShader(vertexShaderHandle);

 final int[] vertexCompileStatus = new int[1];

 GLES20.glGetShaderiv(vertexShaderHandle, GLES20.GL_COMPILE_STATUS,

 vertexCompileStatus, 0);

 if (vertexCompileStatus[0] == 0) {

 GLES20.glDeleteShader(vertexShaderHandle);

 System.err.println(Deleting vertex shader);

 vertexShaderHandle = 0;

 }

 }

 if (vertexShaderHandle == 0) {

 }

 int fragmentShaderHandle = GLES20

 .glCreateShader(GLES20.GL_FRAGMENT_SHADER);


 if (fragmentShaderHandle != 0) {

 System.out.println(Fragmentshaderhandle success);

 GLES20.glShaderSource(fragmentShaderHandle, fragmentShader);

 GLES20.glCompileShader(fragmentShaderHandle);

 final int[] fragmentCompileStatus = new int[1];

 GLES20.glGetShaderiv(fragmentShaderHandle,

 GLES20.GL_COMPILE_STATUS, fragmentCompileStatus, 0);

 if (fragmentCompileStatus[0] == 0) {

 GLES20.glDeleteShader(fragmentShaderHandle);

 fragmentShaderHandle = 0;

 }

 }


 if (fragmentShaderHandle == 0) {

 System.err.println(Error creating fragment shader.);

 }


 System.out

 .println(linkShaders(vertexShaderHandle, fragmentShaderHandle));

 }


 private int linkShaders(int vertexHandle, int fragmentHandle) {

 int programHandle = GLES20.glCreateProgram();


 if (programHandle != 0) {

 GLES20.glAttachShader(programHandle, vertexHandle);

 GLES20.glAttachShader(programHandle, fragmentHandle);

 GLES20.glBindAttribLocation(programHandle, 0, a_Position);

 GLES20.glBindAttribLocation(programHandle, 1, a_Color);

 GLES20.glLinkProgram(programHandle);

 final int[] linkStatus = new int[1];

 GLES20.glGetProgramiv(programHandle, GLES20.GL_LINK_STATUS,

 linkStatus, 0);

 if (linkStatus[0] == 0) {

 GLES20.glDeleteProgram(programHandle);

 programHandle = 0;

 }

 }


 if (programHandle == 0) {

 System.err.println(Error creating program.);

 }

 return programHandle;

 }

 }



 And the call to that function / class:

 private void finishLoading() {


 mGLView.queueEvent(new Runnable() {

 public void run() {

 shader = new Shader(asset(shaders/vertex/default),

 asset(shaders/fragment/default));

 }

 });



 Questions and help greatly appreciated! 
  



-- 
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 get data from Wamp server Database on spinner in android

2012-11-01 Thread bob
 

I reckon I would subclass View and create a Product_View class.


Product_View would override the onDraw method and draw a product thumbnail 
next to its name.



On Thursday, November 1, 2012 10:14:30 AM UTC-5, S Awan wrote:

 Hi,
 I have taken spinner and have database in Wamp Server.. I want to get data 
 like Product Name and Product Image from database on spinner in android.I 
 have done from different ways but not working..can any one give me the 
 sample code or any instructions about this??please reply..Thank you
  
 This is my CutomSpinnerDemo.java
  
  package com.CustomDemo;
  import java.net.MalformedURLException;
  import java.net.URL;
  import java.util.ArrayList;
  import android.app.Activity;
  import android.content.Context;
  import android.content.Intent;
  import android.graphics.Bitmap;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.AdapterView;
  import android.widget.AdapterView.OnItemSelectedListener;
  import android.widget.RelativeLayout.LayoutParams;
  import android.widget.ArrayAdapter;
  import android.widget.BaseAdapter;
  import android.widget.ImageView;
  import android.widget.ListView;
  import android.widget.RelativeLayout;
  import android.widget.Spinner;
  import android.widget.TextView;
  import android.widget.Toast;
  public class CustomSpinnerDemo extends Activity {
   ArrayAdapter list1;
   
  /*String[] strings1 = { Jewellery, Ear Rings, Rings, 
 Neckless,Bracelets,Nose Pins };
   String[] subs1 = { sobia , Silver sub, Antique sub, Diamond sub,
 SIlver sub, White Gold sub };
   int arr_images[] = { R.drawable.jj22, R.drawable.e1, R.drawable.r13,
 R.drawable.jj11, R.drawable.b1, R.drawable.ns1 };*/
  
int mGalleryInitializedCount = 0;
int mGalleryCount = 0;

   @Override
   public void onCreate(Bundle savedInstanceState) {
try {
super.onCreate(savedInstanceState);
Helper objHelper = new Helper();

} catch (Throwable t) {
 Toast.makeText(this, Request failed:  + t.toString(),
   Toast.LENGTH_LONG).show();}
   int count = Helper.vctrMainCategoriesTitle.size();

for(int i =0;icount;i++)
{  
list1.add(Helper.vctrMainCategoriesTitle.elementAt(i));
}
setAdapter(new MyAdapter(getBaseContext()));
setAdapter(new ArrayAdapterString(this,
   R.layout.spin,R.id.spinner
   )); 
}

private void setAdapter(ArrayAdapterString arrayAdapter) {
// TODO Auto-generated method stub

   }
private void setAdapter(MyAdapter myAdapter) {
// TODO Auto-generated method stub

   }
   public class MyAdapter extends BaseAdapter {

int counter = 0;
Context mContext;
Activity a;
//String[] subTitle;

public MyAdapter(Context context) {
 this.mContext = context;
 this.a = a;
 //this.subTitle=sub;
 
}

public int getCount() {
 // TODO Auto-generated method stub
 return Helper.vctrMainCategoriesTitle.size();
}
   
public Object getItem(int position) {
 return position;
}
public long getItemId(int position) {
 return position;
}

   
public View getView(int position, View convertView, ViewGroup parent) {
 ImageView text = new ImageView(mContext);
 Helper helper = new Helper();
 
 String strUrl = 
 Helper.vctrMainCategoriesImageUrls.elementAt(counter).toString();// getting 
 url of the images
 System.out.println(Urls + strUrl);
 URL url =null;
 try {
  url = new URL(strUrl);
 } catch (MalformedURLException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
 }
 Bitmap bitmap = helper.loadPhotoBitmap(url);
 text.setImageBitmap(bitmap);
 RelativeLayout layout = new RelativeLayout(mContext);
 //RelativeLayout.LayoutParams params = new 
 RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
 //layout.setLayoutParams(params);
 TextView text1 = new TextView(mContext);
 text1.setTextSize(30);

 
 text1.setText(Helper.vctrMainCategoriesTitle.elementAt(counter).toString());
 LayoutParams params1 = new  
 LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
 params1.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
 text1.setLayoutParams(params1);
 layout.addView(text1);
 ImageView image = new ImageView(mContext);
 image.setImageBitmap(bitmap);
 layout.addView(image);
 counter++;
 return layout;
}

   }
   
   public void addListenerOnSpinnerItemSelection() {
Spinner mySpinner = (Spinner) findViewById(R.id.spinner);
mySpinner.setOnItemSelectedListener(new CustomOnItemSelectedListener());

mGalleryCount = 2;
}
public class CustomOnItemSelectedListener implements 
 OnItemSelectedListener {
public void onItemSelected(AdapterView? parent,Spinner s, View view,  
 int position,
   

[android-developers] Re: Regarding Intents

2012-11-01 Thread bob
Intent intent = new Intent( Intent.ACTION_DIAL, Uri.parse( tel: 
555-2368));
startActivity( intent);

*Meier, Reto (2012-04-05). Professional Android 4 Application Development 
(Wrox Professional Guides) (Kindle Locations 4433-4434). John Wiley and 
Sons. Kindle Edition. *

On Thursday, November 1, 2012 8:12:08 AM UTC-5, krithika rajan wrote:

 Hi im a newbee to android. im unable to understand android concept.i wnet 
 through many sites but i couldnt understand
 could u please explain what is Intent,Intent Object and what is the use of 
 Intents with clear example.
 thanks in 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: Creating OpenGL shaders from an alternate class

2012-11-01 Thread Braindrool
Hmm, I just assumed that it was an API / syntax error. I'll return later.

-- 
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 someone answer me a question about webkit android?

2012-11-01 Thread Zhang Jiejing
Hi Fang,

I found same issue too.

From kernel level, I found the cause of slow is 
in UPDATE_FRAME_CACHE_IF_LOADING WebViewCore.java called fsync in some 
place, maybe the sqlite operation in this function,
in a slow storage, it maybe cause 3 - 5 seconds longer.

Do you find way to remove this mechanism finally ?


On Friday, October 19, 2012 12:53:07 PM UTC+8, 方灿 wrote:

 Hi all ,my question is :
In android 4.0 webkit,there is a FrameCache Mechanism.
 I have found that when a webkit is rendering a webpae,it would call 
 updateFrameCache method at the RecordPictureSet method of WebViewCore.cpp.
 But when the web page is Complex,the updateFrameCache will reduce 
 the rendering performance because it has record pictureset for twice.
 so,I want to remove this Mechanism,can someone tell me What is the 
 impact?In other words,what is the purporse of the FrameCache?
   
 
 In any case,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] In App Billing: making sense of errors in the logs.

2012-11-01 Thread Bram Stolk
Hi,

I am integrating In App Billing, going by the Dungeons example from the SDK.
android.test.purchased works for me, but when getting my own products, it 
fails.

I try to make sense of the errors in the logs.
There are so many to choose from.

Some info on my setup:
- I test with proper test account, as added to Google Play console.
- Test user has working google wallet and can purchase published 3rd party 
apps.
- Test device is up to date Acer A100
- BILLING permission is spec'd in the Manifest.
- I use the same app version for testing, as was uploaded to google.
- Product was marked as active in Google Play Console.
- I get a positive result back when I check for Billing Supported.

My questions:
(1) What does this mean: *Saving carrier billing params failed*
(2) What is the significance of:* Attempt to delete 
'paramsPMEA2H1cBHnCGCAFXApRbQ' failed!*
(3) What target is referred to in *The target server failed to respond*?
(4) What is *Unexpected response code 500*?
(5) And finally: what is *[DF-BPA-13]*? This code actually shows up in a 
dialog on the device.

D/BillingService( 2501): RequestPurchase
D/Finsky  ( 2188): [271] MarketBillingService.getPreferredAccount: 
com.steenriver.littlecrane: Account from first account.
D/Finsky  ( 2188): [271] MarketBillingService.getPreferredAccount: 
com.steenriver.littlecrane: Account from first account.
I/ActivityManager(  144): START {act=android.intent.action.VIEW 
cmp=com.android.vending/com.google.android.finsky.activities.IabActivity 
(has extras)} from pid -1
D/BillingService( 2501): request id: 1802264350828807725
V/threaded_app( 2501): SaveInstanceState: 0x52a1b0
I/crane   ( 2501): State saved
V/threaded_app( 2501): APP_CMD_SAVE_STATE
V/threaded_app( 2501): Pause: 0x52a1b0
V/threaded_app( 2501): activityState=13
V/threaded_app( 2501): WindowFocusChanged: 0x52a1b0 -- 0
D/Finsky  ( 2188): [1] SelfUpdateScheduler.checkForSelfUpdate: Skipping 
self-update. Local Version [8015016] = Server Version [0]
I/ActivityManager(  144): Displayed 
com.android.vending/com.google.android.finsky.activities.IabActivity: +73ms
W/Finsky  ( 2188): [1] CarrierParamsAction.run: Saving carrier billing 
params failed.
E/Finsky  ( 2188): [294] FileBasedKeyValueStore.delete: Attempt to delete 
'paramsPMEA2H1cBHnCGCAFXApRbQ' failed!
D/Finsky  ( 2188): [1] GetBillingCountriesAction.run: Skip getting fresh 
list of billing countries.
I/ActivityManager(  144): Start proc com.google.android.gsf.login for 
service 
com.google.android.gsf.login/com.google.android.gsf.loginservice.GoogleLoginService:
 
pid=2516 uid=10036 gids={3003, 1015, 1007, 2001, 3006}
I/ElegantRequestDirector( 2188): I/O exception 
(org.apache.http.NoHttpResponseException) caught when processing request: 
The target server failed to respond
I/ElegantRequestDirector( 2188): Retrying request
I/ElegantRequestDirector( 2188): I/O exception 
(org.apache.http.NoHttpResponseException) caught when processing request: 
The target server failed to respond
I/ElegantRequestDirector( 2188): Retrying request
D/dalvikvm( 2188): GC_CONCURRENT freed 559K, 8% free 7736K/8391K, paused 
3ms+7ms
E/Volley  ( 2188): [277] BasicNetwork.performRequest: Unexpected response 
code 500 for 
https://android.clients.google.com/fdfe/details?doc=inapp:com.steenriver.littlecrane:premium
D/DfeApi  ( 2188): [1] DfeRequest.deliverError: Not delivering error 
response for request=[[ ] 
https://android.clients.google.com/fdfe/details?doc=inapp:com.steenriver.littlecrane:premium
 
NORMAL 8], error=[DisplayErrorMessage[Error retrieving information from 
server. [RPC:AEC:0]]] because response already delivered.
E/Volley  ( 2188): [276] BasicNetwork.performRequest: Unexpected response 
code 500 for https://android.clients.google.com/fdfe/purchase
W/Finsky  ( 2188): [1] CheckoutPurchase.onErrorResponse: 
DisplayErrorMessage[Error processing purchase. [DF-BPA-13]]
E/Finsky  ( 2188): [1] CheckoutPurchase.setError: type=UNKNOWN, code=-1, 
message=Error processing purchase. [DF-BPA-13]

Many thanks!

  Bram Stolk

-- 
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: Audio Play

2012-11-01 Thread rahul B
Dear,

Forward your code. Can help you out.

On Fri, Nov 2, 2012 at 2:46 AM, bob b...@coolfone.comze.com wrote:

 Be sure to use this approach:

  final Button button = (Button) findViewById(R.id.button_id);
  button.setOnClickListener(new View.OnClickListener() {
  public void onClick(View v) {
  // Perform action on click
  }
  });


 On Thursday, November 1, 2012 12:25:21 AM UTC-5, Sadhna Upadhyay wrote:

  Hi everybody i am playing a audio o button click then it is playin twice
 on single click why it is happening,i dont know please help me if any one
 of you know the reason.

  --
 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] single selection listveiw

2012-11-01 Thread rauf qureshi
Thanks for reply me but i did that by check box.



following code i have used for that

checkProfileItem is object of checkbox and it is declare in ViewHolder
class.

   holder.checkProfileItem.setId(position);
holder.checkProfileItem.setOnClickListener(new OnClickListener() {
public void onClick(View v) {

for (int i = 0; i  ProfileListBean.profileList.size();
i++) {
if (v.getId() == i) {

//holder.checkProfileItem.setChecked(true);
checkArray[i] = true;
//Log.v(check, +position);
} else {
checkArray[i] = false;
}
}
notifyDataSetChanged();
 }

});

if(checkArray[position]){
holder.checkProfileItem.setChecked(true);
} else {
holder.checkProfileItem.setChecked(false);
}


Thank you
Regards,
Rauf Qureshi


On Wed, Oct 31, 2012 at 12:04 PM, Narendra Singh Rathore 
nsr.curi...@gmail.com wrote:



 On Wed, Oct 31, 2012 at 10:51 AM, rauf qureshi qureshira...@gmail.comwrote:

 hello friends,

 I am developing listview with customerAdapter which extends
 baseAdapter,in each item of list there is two textview and one check box is
 there , so i want to select one check box at a time but i am unable to do
 that can any body give me solution for that


 Hi Rauf,
 I guess RadioButton is better way to do what you want, as you can use
 RadioGroup, as parent view to the radiobuttons if you want single selection.

 As well as I guess using checkbox should be preferred in case of selecting
 multiple items.

 You can ask if you have further queries.


 Thanks and Regards,
 NSR

  --
 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] Is the 'back' button still kosher?

2012-11-01 Thread Keith Wiley
My understanding is that modern Android best practice is to not use the 
system-level menu button or system-level options menu anymore since such 
buttons are frequently difficult to access or even absent on some devices.  
I have gutted all menu access from my app as a result (I admit, it is quite 
tedious to get access to the menus on some devices since you have to tap at 
least once just to get a menu bar to appear and then again on a menu icon 
to get the menu...and I'm not sure even that approach works on all of the 
most modern devices).

What I'm not sure about is whether I can still rely on the standard 'back' 
button or whether I need to add such functionality to my UI (add a soft 
button on my screen) on the concern that some devices may not present a 
usable back button to the user.

Any thoughts on this subject?

-- 
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