[android-developers] Internal code flow for getSystemService() and getService() APIs

2016-11-23 Thread Pritam Nandy
Hi,

I have created a System Service and all it's underlying functionalities 
have been implemented.
To test and use it's functionalities I have created a test application. 
>From the Test Application, when I call getService() with my service name it 
returns null.
I want to know what is the difference between calling getSystemService() 
and getService() APIs from applications and what would be it's underlying 
code flow in the framework or native layers?

-- 
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/133c5856-9a2e-474f-9d89-ca379bde0373%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Is it possible to revert back to Honeycomb without rooting the Mototrola Xoom which got upgraded to ICS?

2012-02-22 Thread Pritam
Thanks Mark for suggesting appropriate place.
Just in case some one comes up to this question later,
I had posted it on Motorola forum here where Motorola technical
support clarified there's no way without unlocking the device here:

http://community.developer.motorola.com/t5/Android-App-Development-for/Revert-back-Xoom-to-Honeycomb-without-rooting-which-got-upgraded/m-p/22966#M4870

Also if someone's more interested here is a link for guidelines from
official Motorola site but that voids warrenty:
http://developer.motorola.com/products/software/

- Pritam

On Feb 13, 6:20 pm, Mark Murphy  wrote:
> On Mon, Feb 13, 2012 at 12:27 AM, Pritam  wrote:
> > I upgraded Motorola Xoom to official update of Icecream Sandwich 4.0.3
> > Now, for some reason I need Honeycomb back on Xoom. How should this be
> > achieved ?
>
> Start by finding a more relevant list. This list is for developing
> applications with the Android SDK, not for firmware loads.
>
> Since this is a Motorola device, try the MOTODEV discussion boards.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android 4.0 Programming Books:http://commonsware.com/books

-- 
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 it possible to revert back to Honeycomb without rooting the Mototrola Xoom which got upgraded to ICS?

2012-02-12 Thread Pritam
I upgraded Motorola Xoom to official update of Icecream Sandwich 4.0.3
Now, for some reason I need Honeycomb back on Xoom. How should this be
achieved ?

I did a Factory reset , but this only went back to 4.0.3 with all apps
and settings deleted. I need an official and recommended way which
will not void any warranty or broke the device.
If someone can point to a page/link officially from Google, which
gives steps for this, that would completely answer this question.

-- 
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: Does icecream sandwich 4.0.3 enforces more restrictions for application developer in threading usage ?

2012-02-08 Thread Pritam
Yes that would help. Thanks.

On Feb 8, 10:40 pm, Streets Of Boston  wrote:
> As long as you don't do any long-lasting operations (network) on the UI
> thread, all should be fine.
> As long as you don't do any tasks that may include wait-states
> (db/file-system/etc) on the UI thread, you won't see much of hiccoughs in
> your app's UI.
>
> Your background threads doing the hard work should be fine.
>
> Note, however, that background threads (including those used in AsyncTasks'
> executions) won't keep a process alive when the process is scheduled to be
> killed.
>
> It could be that ICS is a bit more aggressive in killing of
> non-foreground/non-elevated processes, which means that threads still
> running in these processes get killed as well.
>
> If you find you have ANR issues, enable StrictMode to find out where the
> issues are in your code.

-- 
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] Does icecream sandwich 4.0.3 enforces more restrictions for application developer in threading usage ?

2012-02-07 Thread Pritam
I am working on an application that was designed for tablet
(specifically tested well on Motorola Xoom and Samsung Galaxy Tab
10.1). The O.S. which was used was HoneyComb.

Recently after updating the O.S. to official Icecream Sandwich 4.0.3,
that was received as notification update, I find the application is
not at all well.
It lags in performance, gives frequent ANR ( Application not
responding ) dialogs.

While I understand the ANR are related to performing more work in the
UI thread, i need to know does this new android version 4.0.3 enforces
more strict restrictions on number of threads that runs in
background ? Or killing them as the activity exists that started it ?

Application uses threads exclusively to load images from server in
list views. Switching between screens makes each individual image
holder to start a new thread for its loading.
Retesting it on Honeycomb makes it work perfectly fine but not with
4.0.3, Why ?

Question is on whether icecream sandwich 4.0.3 makes changes in this
area at O.S. level handling of threads or activity lifecycle for
developers ?

-- 
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 'Recent' item's bind intent be changed ?

2011-09-18 Thread Pritam
I am not sure on any current available option from API.
If you mean what can be , then yes, we can make it to pass some
predefined extra added with Intent, so we know from where the
application is launched.
I mean if it has been from somewhere out of app control, like the GUI
app in this case.

On Sep 19, 10:25 am, Zsolt Vasvari  wrote:
> What would the API be for such a functionality?  Your app is not
> running, so the user would have to initiate the change using some UI
> paradigm.  Is there such a UI paradigm in Android currently?
>
> On Sep 19, 12:11 pm, Pritam  wrote:
>
>
>
>
>
>
>
> > Hi All,
> > Can we change the intent that is bind to recent item list that appears
> > on long press of 'Home' button? Or to be precise change the extra in
> > it ? I want to do this for my application only.
> > I had put this question 
> > before,http://groups.google.com/group/android-developers/browse_thread/threa...
>
> > but I guess was too long in terms of description :)
> > 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] Can 'Recent' item's bind intent be changed ?

2011-09-18 Thread Pritam
Hi All,
Can we change the intent that is bind to recent item list that appears
on long press of 'Home' button? Or to be precise change the extra in
it ? I want to do this for my application only.
I had put this question before,
http://groups.google.com/group/android-developers/browse_thread/thread/ccf50e4394ba087b

but I guess was too long in terms of description :)
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: What is the sorting order on Android Market?

2011-09-17 Thread Pritam
>From what I guess that while publishing the app, you choose a
category, and your app will appear in this category.
Now it may be too down the list, that is something related to SEO part
similar to search engines, and may depend on many factors other than
ratings, like number of downloads, active downloads, total user
reviews, etc. and all that would obviously never will be openly shared
and will keep changing.
Sometimes it may happen things like,
http://techcrunch.com/2011/09/12/googles-auto-correct-killed-the-launch-of-our-android-app/,
though now fixed.

On Sep 17, 9:46 pm, sblantipodi  wrote:
> Hi all...
>
> Is there someone who can help me understanding how android market sort
> the apps?
>
> One of my financial apps has 4.5stars, it has more download than other
> apps but it isn't displayed in the financial section of the market.
>
> Why?
> How the market sort the apps?
>
> 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] getIntent().removeExtra() in Activity doesn't work for android:launchmode=“singleTask”?

2011-09-17 Thread Pritam
0 down vote favorite
share [fb] share [tw]


I am relaunching my HomeActivity and setting an extra "relaunchstatus"
in the Intent. In Activity's onCreate() method I check this value, if
present, show some alert.

The launchmode for this activity is android:launchmode="singleTask".

The issue comes after the user sees this alert and close it and again
close the activity by pressing Back button. Now if he starts it from
Recent list of apps by long pressing 'Home' button, then the same
intent which had an extra "relaunchstatus" in it is used and again the
alert comes.

This keeps on as long as user comes from the recent items (OK, may be
recent launch apps uses the same intent which had the extra
"relaunchstatus" set in it).

So I tried to remove this extra by handling BACK_KEY press just before
the activity finishes itself, using
getIntent().removeExtra("relaunchstatus") , still this extra exists in
the new launch from Recent items.

However this is not the case if I start the app from launcher menu
icon.

Also, I finish my activity before relaunching, in this particular
case. Hence its onCreate() is called instead of onNewIntent() as it do
not exist in the task stack. In other cases I need it to reuse, so
cannot remove the "singleTask" option

So If Activity's getIntent() is giving you a copy of Intent that
launched it, its not like a reference to same Intent object on which
changes will be permanent. If this is the case, then we will need to
do it from current device GUI (like HTC Sense etc. ) , whose recent
items are bind to that intent , which may not be possible ?

One way is to set setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS),
while restarting it again. So for this case it won't appear in recent
menu, still there needs to be some other way ?

-- 
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: Nexus S and gingerbread Sensor events — Which sensor uses what hardware ?

2011-03-17 Thread Pritam
Thanks Mathias, this answers my question :)
But then developers will have a tough time to find which device uses
'fused' sensors in what way ( possibly getting the details from
manufacturer ), if they need to care this for some reason.
Like in my case I wanted to confirm that Nexus S do not use gyroscope
for fused sensors.

How about making this info. available through API itself for each
sensor events ? Just a thought.
Thanks.


On Mar 17, 12:56 am, Mathias Agopian  wrote:
> Hello,
>
> TYPE_ACCELEROMETER uses the accelerometer and only the accelerometer.
> It returns raw accelerometer events, with minimal or no processing at
> all.
>
> TYPE_GYROSCOPE (if present) uses thegyroscopeand only thegyroscope.
> Like above, it returns raw events (angular speed un rad/s) with no
> processing at all (no offset / scale compensation).
>
> TYPE_ORIENTATION is deprecated. It returns the orientation as yaw/
> pitch/roll in degres. It's not very well defined and can only be
> relied upon when the device has no "roll". This sensor uses a
> combination of the accelerometer and the magnetometer. Marginally
> better results can be obtained using SensorManager's helpers. This
> sensor is heavily "processed".
>
> TYPE_LINEAR_ACCELERATION, TYPE_GRAVITY, TYPE_ROTATION_VECTOR are
> "fused" sensors which return respectively the linear acceleration,
> gravity and rotation vector (a quaternion). It is not defined how
> these are implemented.
> On some devices they are implemented in h/w, on some devices they use
> the accelerometer + the magnetometer, on some other devices they use
> the gyro.
>
> On Nexus S and Xoom, thegyroscopeis currently NOT used. They behave
> as if there was no gyro available, like on Nexus One or Droid. We are
> planing to improve this situation in a future release.
>
> Currently, the only way to take advantage of the gyro is to use
> TYPE_GYROSCOPE and integrate the output by hand.
>
> I hope this helps,
>
> Mathias
>
> On Mar 13, 3:03 am, Pritam  wrote:
>
> > Could someone help to know which sensor uses which part of phone's
> > hardware or in what combination of this on Nexus S in android 2.3 ?
>
> > Following are the sensor events:
>
> > TYPE_ACCELEROMETER
>
> > TYPE_GYROSCOPE
>
> > TYPE_GRAVITY
>
> > TYPE_LINEAR_ACCELERATION
>
> > TYPE_ORIENTATION
>
> > TYPE_ROTATION_VECTOR
>
> > I assume first 2 corresponds to separate hardware (accelerometer and
> >gyroscope),
>
> > but how with the other remaining ones ?
>
> > Does TYPE_LINEAR_ACCELERATION uses both Acceleromter andGyroscope
> > hardware at its best?
>
> > I am actually interested in "linear aceleration" so should I need not
> > worry about gyro events, if "linear acceleration" internally uses gyro
> > to give out values ?
>
> > Also when tested on device ( Nexus S ) linear accelerations found to
> > give high values for minor shakes , so assuming this removes gravity
> > vector, this was not expected.
>
> > 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: Nexus S and gingerbread Sensor events — Which sensor uses what hardware ?

2011-03-15 Thread Pritam
Yes I had known the gyroscope gives angular velocity and not
orientation.
I just want to confirm that none of the other sensor events ( other
than TYPE_GYROSCOPE ) consider gyroscope hardware inputs to give out
its results.
Otherwise the results would be quite better.

Also with shakes I mean with very small movements this was large
enough to just give just my linear accceleration and would normally
come only if it used only accelerometer for its input.
If gyroscope is combined to the results then this would not be the
case.

http://groups.google.com/group/android-developers/browse_thread/thread/a8b885c13c1ed87f/7eff726b9ee3d918?lnk=gst#7eff726b9ee3d918

In this post it seems that its still not used and will be in near
future.
But thanks for the answer.

On Mar 15, 5:06 am, ip332  wrote:
> Here is the list of devices and the correspondedSensor.TYPE_XXX:
> 1.Accelerometer (TYPE_ACCELEROMETER, TYPE_GRAVITY and
> TYPE_LINEAR_ACCELERATION)
> 2.Magnetic fieldsensor(TYPE_MAGNETIC_FIELD,TYPE_ORIENTATION)
> 3.Gyroscope(TYPE_GYROSCOPE, TYPE_ROTATION_VECTOR)
> 4.Lightsensor(TYPE_LIGHT)
> 5.Proximity (TYPE_PROXIMITY)
>
> > Does TYPE_LINEAR_ACCELERATION uses both Acceleromter andGyroscope
> > hardware at its best?
>
> No. TYPE_ACCELEROMETER reports absolute (raw) acceleration. According
> to Android on-line docs, "The output of the accelerometer, gravity and
> linear-acceleration sensors must obey the following relation:
> acceleration = gravity + linear-acceleration"
>
> It looks like there is a common misunderstanding of MEMS gyro. It only
> measures angular speed and nothing else. So if you do not rotate the
> phone gyro output should be 0 even if you are accelerating. In other
> words, gyro gives you the changes in orientation when the compass
> (TYPE_ORIENTATION)  - the absolute orientation. It seems to be a very
> subtle difference but gyro gives better results in a real world due to
> less sensitivity to the magnetic fields.
>
> > Also when tested on device ( Nexus S ) linear accelerations found to
> > give high values for minor shakes , so assuming this removes gravity
> > vector, this was not expected.
>
> Why not? A shake can have large acceleration value, here is an example
> I recorded on my phone:
>     7.1234417,6.033814,3.5140498
> while in rest the same device shows:
>     0.20430522,0.47671217,9.493382
>
> Removing gravity from the acceleration is only one issue.
> You also need to take care about noise, orientation and variable
> timing.
>
> On Mar 13, 3:03 am, Pritam  wrote:
>
> > Could someone help to know whichsensoruses which part of phone's
> > hardware or in what combination of this on Nexus S in android 2.3 ?
>
> > Following are thesensorevents:
>
> > TYPE_ACCELEROMETER
>
> > TYPE_GYROSCOPE
>
> > TYPE_GRAVITY
>
> > TYPE_LINEAR_ACCELERATION
>
> > TYPE_ORIENTATION
>
> > TYPE_ROTATION_VECTOR
>
> > I assume first 2 corresponds to separate hardware (accelerometer and
> >gyroscope),
>
> > but how with the other remaining ones ?
>
> > Does TYPE_LINEAR_ACCELERATION uses both Acceleromter andGyroscope
> > hardware at its best?
>
> > I am actually interested in "linear aceleration" so should I need not
> > worry about gyro events, if "linear acceleration" internally uses gyro
> > to give out values ?
>
> > Also when tested on device ( Nexus S ) linear accelerations found to
> > give high values for minor shakes , so assuming this removes gravity
> > vector, this was not expected.
>
> > 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: Gyroscope affecting other sensor event types?

2011-03-14 Thread Pritam
I did also expect Linear acceleration sensor event would use gyroscope
to give out pure movement acceleration ( without gravity ) on phone's
axis.
But with actual device I found the readings bad and now saw this
message.
So still gyro not used in any other sensor events ?

I would like to get pure accelerations which do not include gravity.
As per definition Linear acceleration should have done that by
combining accelerometer as well as gyroscope inputs, but currently
it's not and left to developers.
So any links to achieve this or would help on this ?

On Mar 10, 3:12 pm, nadam  wrote:
> Just got an email from Google that Nexus S and Xoom currently do not
> use the gyroscope for TYPE_GRAVITY, TYPE_LINEAR_ACCELERATION and
> TYPE_ROTATION_VECTOR but it will be improved sometime in the future.
> Currently the only way to us the gyroscope in Java is to use
> TYPE_GYROSCOPE where you get rotational velocity.
>
> On Jan 15, 9:05 am, nadam  wrote:> Sorry for the bad link. I 
> found a discussion indicating that devices
> > with gyro will include this input in the calculation of the new
> > events. I assume this is the case for Nexus S too.
>
> > On 11 Jan, 16:19, nadam  wrote:
>
> > > In Android 2.3 we got three new sensor event types:
>
> > > TYPE_GRAVITY
> > > TYPE_LINEAR_ACCELERATION
> > > TYPE_ROTATION_VECTOR
>
> > > I assumed that this had something to do with thegyroscope
> > > (TYPE_GYROSCOPE) but looking at the code it seems that TYPE_GRAVITY
> > > and TYPE_LINEAR_ACCELERATION only uses the accelerometer, and
> > > TYPE_ROTATION_VECTOR uses only the accelerometer and the 
> > > compass.http://www.google.co.in/codesearch/p?hl=en#uX1GffpyOZk/services/senso...
>
> > > Is this just the default implementation whereas for instance Google
> > > Nexus S also uses thegyroscope?

-- 
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] Nexus S and gingerbread Sensor events — Which sensor uses what hardware ?

2011-03-14 Thread Pritam
Could someone help to know which sensor uses which part of phone's
hardware or in what combination of this on Nexus S in android 2.3 ?

Following are the sensor events:

TYPE_ACCELEROMETER

TYPE_GYROSCOPE

TYPE_GRAVITY

TYPE_LINEAR_ACCELERATION

TYPE_ORIENTATION

TYPE_ROTATION_VECTOR

I assume first 2 corresponds to separate hardware (accelerometer and
gyroscope),

but how with the other remaining ones ?

Does TYPE_LINEAR_ACCELERATION uses both Acceleromter and Gyroscope
hardware at its best?

I am actually interested in "linear aceleration" so should I need not
worry about gyro events, if "linear acceleration" internally uses gyro
to give out values ?

Also when tested on device ( Nexus S ) linear accelerations found to
give high values for minor shakes , so assuming this removes gravity
vector, this was not expected.

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] java.lang.NullPointerException

2009-07-22 Thread Pritam

Hi,

I have one Activity, that starts one Service and my service will lunch
one Activity, i wanna to stop the Activity which one started my my
Service after few seconds.
Is there any way to achieve. Has anyone experienced this type of
scenario.


--
Regards
Pritam

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