[android-developers] Re: MVC Architecture

2012-01-14 Thread Indicator Veritatis
Why? Because the Wikipedia entry on the topic just is not that good.
In fact, MOST of the sites that show up in a Google search for MVC are
just not that good.

The only sites I found on the topic that are good are: 1) apple
developer sites on it and 2) IBM developer works. (in the developer
works search field, enter model view controller java). 3) Ward
Cunningham's Wiki on Patterns: http://c2.com/cgi-bin/wiki?ModelViewController

So I suggest instead of just Googling mvc or model view controller
he should narrow things down to the good stuff with apple developer
mvc. The article in Cocoa Design Patterns is particularly good,
though several others are also well worth reading.

Everything I have read in the Apple Developer Library concerning MVC
is quite applicable to Android -- and MUCH better written than
anything in the Android documentation. Let me repeat that: MUCH better
written.

Once you have read a few of these sites, you will understand the
pitfalls of the point of view that In most cases, I think, you are a
mere user of MVC implemented by
Android SDK. If you are a naive user of the SDK classes, and are not
very aware of what the MVC pattern is, then you will make mistakes in
applying it despite the design of the classes, and you will NOT
benefit from the 'pattern-ness' of the MVC pattern.

A classic example of how to fail to benefit from the pattern-ness is
shown in Lecture 1.pdf of Stanford University's CS193 course on iPhone
programming, which shows both how to do it and how NOT to do it. It is
available from iTunes University, free. Again: everything in that
lecture concerning MVC is just as applicable to the Android SDK. Even
the name changes are slight.

On Jan 13, 1:41 am, Daniel Drozdzewski daniel.drozdzew...@gmail.com
wrote:
 I am with TreKing on this one.

 The question is very vague. Does Sree want to know about MVC in
 general? His question certainly looks so.
 If so, then it's hardly Android SDK, and Wikipedia has an entry for
 it, so why wasting people time and bandwidth.

 This list seems to have a lot of noise like that (victim of Android's
 success) and one receives around 50 posts every hour, out of which
 maybe 3 are relevant, well formed and interesting.

 If it is about MVC in Android, then it is still quite generic and
 speculative, but interesting.

 I don't think that you implement MVC as such as long as you use
 Activity and View objects. You could, when taking full controll of the
 screen, like in a game with your custom UI.

 In most cases, I think, you are a mere user of MVC implemented by
 Android SDK. Activity hosts Views so it is a View + Controller, but
 can easily hold Model objects too, in case when model is small. Model
 could also be implemented separately by a Service or Content Provider.

 Daniel

 On 13 January 2012 08:20, Android2ee mathias.seguy...@gmail.com wrote:









  Ok, nice first answer.
  The question is not stupid, because an Activity mix life cycle and
  view, so implementing MVC is not so obvious. And to make simple, your
  activity manage lifeCycle and delegate GUI to your GUI package. In
  that package you do usual MVC. In fact you implement usual layers
  separation (Model, View, BuisnessService, Service  (i mean android
  service), DAO (that contains usual DAO and your Content providers) and
  you also have the Communication layer and the transversal one), as
  usual in Java. You just need to manage your models' life cycle
  according to your activity life cycle. And it should work.

  On Jan 13, 6:21 am, TreKing treking...@gmail.com wrote:
  On Thu, Jan 12, 2012 at 10:46 PM, Sree sreelathapavul...@gmail.com wrote:
   I want some information about MVC Architecture

 http://www.justfuckinggoogleit.com/

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

 --
 Daniel Drozdzewski

-- 
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] AwesomePagerAdapter initial position

2012-01-14 Thread sheamuso
Does anyone know how to set the initial position of the
AwesomePagerAdapter in the compatibility package.

I've been trying to use setPrimaryItem but don't know how, see my
feeble attempt below but don't know what parameters to pass in


awesomeAdapter = new AwesomePagerAdapter();
awesomePager = (ViewPager) findViewById(R.id.awesomepager);
awesomePager.setAdapter(awesomeAdapter);
awesomeAdapter.setPrimaryItem(null, pos, null);

private class AwesomePagerAdapter extends PagerAdapter {
@Override
public void setPrimaryItem(View collection, int position, Object
object) {
Object primary = instantiateItem(collection, position);
super.setPrimaryItem(collection, position, object);
}
...

-- 
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] Read sensor value without using SensorEventListener

2012-01-14 Thread ambi
Hi,

Is there a way to read the sensor value without using the
SensorEventListener? My understanding is that the
SensorEventListener.onSensorChanged() method will tell me the sensor
value but only when the value changes. I want to read the sensor value
when the user clicks a button.

Thanks,
Ambi.

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

2012-01-14 Thread Dusk Jockeys Android Apps
Thanks Dianne, for such a detailed answer.

I understand the limitations you describe, both of the Compatibility
process and AppWidgets themselves.

The use case of animations here could be considered trivial, but I do
think it adds tremendous perceived value to an app. Consider a simple
Gallery widget, which toggles between a range of the users pre-
selected images every few seconds. An alpha animation which fades in
the new image instead of simply replacing it gives a lot of polish and
wow factor.

Without that animation, it still works, as you point out, but in my
particular case, the animations themselves are really part and parcel
of my app, it being a Weather Widget which has the unique selling
point of being fully animated. With the animation stripped out, the
USP is lost. I guess it then comes down to where you draw the line on
retaining functionality, from my point of view the animation is part
of the functionality, as it is the raison d'etre of the app...

As the animations are fully valid and supported by the SDK, I would
argue that moving forward they should be a part of the CTS,
notwithstanding the difficulty of actually testing that! But wouldn't
that same difficultly be present testing that the particular
implementation supported animations on normal views and layouts within
Activities?

I guess you are right and I just lucked out here, the full OpenGL
Samsung homescreen sounds like the most likely root of the problem. I
logged the issue with Samsung development team, and they reproduced it
and marked it for further action in a future firmware, so let's hope
that in ICS it is fixed in their homescreen.

Anyway thanks again for taking the time to reply and for filing this
for future investigation, I appreciate it.

Regards,
James
Dusk Jockeys Android Apps
http://duskjockeys.blogspot.com/


On Jan 14, 2:11 am, Dianne Hackborn hack...@android.com wrote:
 On Fri, Jan 13, 2012 at 5:13 AM, Dusk Jockeys Android Apps 

 duskjock...@gmail.com wrote:
  Thanks Dianne, for this infomation on Compatibility Testing.

  Couuld you clarify the exact scope? Is it the devices core API that
  have to pass or their implementation of it?

 It is everything covered in the CTS tests.  These test public APIs amongst
 other things.

  On the latest Samsung Tablets (e.g. Tab 7 Plus) the LayoutAnimation on
  AppWidgets doesn't work in their TouchWiz homescreen. From the log cat
  it seems they are deliberately stripping them out.
  This works perfectly in AppWidgets in the emulator from all APIs since
  1.5, and on most other realworld devices.
  However, if I install another Homescreen app on the Tablet such as Go
  Launcher, the AppWidgets are fine and display the LayoutAnimations
  correctly.

 Hm, that is certainly unfortunate.  I can imagine good reasons for this --
 for example if their home screen is all implemented in OpenGL, they would
 need to render the app widgets into a separate texture and draw them to the
 screen with that.  This would make executing animations and such in them
 pretty problematic.  I'll file an issue for this to have it investigated.

  So it their Touchwiz homescreen covered by the CTS, or do they pass
  because their underlying Android implementation supports it, as shown
  by Go Launcher, and it is just my tough luck that their particular
  Home Screen is not fully featured?

 Well to be honest it is hard for CTS specifically to cover this kind of
 thing, because it is pretty unclear how to write an API unit test that is
 able to verify that some other application is performing the animation on
 the screen.

 However, the overall CDD covers a lot of things -- for example if you look
 athttp://static.googleusercontent.com/external_content/untrusted_dlcp/s...
 there
 is section 3.8.1 on app widgets, with the relevant requirement being:

 Device implementations MAY substitute an alternative to the reference
 Launcher (i.e. home screen). Alternative
 Launchers SHOULD include built-in support for AppWidgets, and expose user
 interface affordances to add,
 configure, view, and remove AppWidgets directly within the
 Launcher.Alternative Launchers MAY omit these user
 interface elements; however, if they are omitted, the device implementation
 MUST provide a separate application
 accessible from the Launcher that allows users to add, configure, view, and
 remove AppWidgets.
 Device implementations must be capable of rendering widgets that are 4 x 4
 in the standard grid size. (See the App
 Widget Design Guidelines in the Android SDK documentation [Resources, 18]
 for details.

 So I think technically right now there is nothing wrong with not showing
 animations, as long as the app widget is still functional.  It is worth
 considering whether this requirement should be more specific...  though to
 be honest, this may just become irrelevant since with 4.0 the UI is all
 hardware accelerated so there would be little benefit anymore to use OpenGL
 to implement launcher (if that is what they 

[android-developers] intent action.CALL_PRIVILEGED

2012-01-14 Thread Live Happy
i used this code in the manifest file

intent-filter 
action android:name=android.intent.action.CALL_PRIVILEGED /
category android:name=android.intent.category.DEFAULT /
data android:scheme=tel /
/intent-filter

but i cant find the .CALL_PRIVILEGED in the intent action to access the
event

if ( intent.getAction().equals(Intent.ACTION_CALL_PRIVILEGED) )

it is there any other action can i use it to access it

thanks for reply

-- 
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: Unable to execute Bluetooth HDP Demo

2012-01-14 Thread Fernando Almeida
Hi jfernandez... i upgrade my android version to 4.03 and still can't
connect...

Could you please show me the changes that you made?

Thank you

On 13 Jan, 10:57, jfernandez jorge.fernandez.gonza...@gmail.com
wrote:
 Hi again,

 Well, after upgrading my Android 4.0 to 4.03, and adding some changes
 to the BluetoothHDPsample, I'm able to connect to the biomedical
 device, as well as I'm able to read/write data from/to theHDP
 channel. So, it seems the problem has been fixed in this new Android
 version.

 Regards.

 On 15 dic 2011, 18:30, jfernandez jorge.fernandez.gonza...@gmail.com
 wrote:







  Hi all,

  I'm executing theBluetoothHDPDemo [1]  (offered from Android 4.0
  Ice Cream Sandwich) in my Android smartphone. When I have registered
  the application in order to receive data, and I have paired the
  biomedical device with the smartphone, I try to open the channel
  connection and I can see that the device starts sending data to the
  smartphone. However, the smartphone is unable to open the channel
  connectionHDP.

  At the end of this message you can see the output obtained in the
  LogCat.

  Has anybody achieved to run successfully this sample about the use of
  theBluetoothHealth Profile API? Any ideas?

  Thanks. Regards.

  [1]http://developer.android.com/resources/samples/BluetoothHDP/index.html

  This is the log that I obtain:

  12-15 16:40:54.048: I/BluetoothHDPService(1105): connectChannel()
  12-15 16:40:54.068: D/BluetoothService(147): CONNECTION_STATE_CHANGE:
  00:80:25:14:A1:BC: 0 - 1
  12-15 16:40:55.169: D/ConnectivityService(147):
  handleInetConditionHoldEnd: net=1, condition=0, published condition=0
  12-15 16:40:59.393: D/BluetoothEventLoop(147): Device property
  changed: 00:80:25:14:A1:BC property: Connected value: true
  12-15 16:41:00.024: D/BluetoothEventLoop(147): Health Device :
  devicePath: /org/bluez/278/hci0/dev_00_80_25_14_A1_BC:channelPath:/org/
 bluez/278/hci0/dev_00_80_25_14_A1_BC/chan3115:existstrue
  12-15 16:41:00.034: E/BluetoothService.cpp(147):
  getChannelApplicationNative
  12-15 16:41:00.044: E/bluetooth_common.cpp(147):
  dbus_func_args_timeout_valist: D-Bus error in Acquire:
  org.bluez.Error.HealthError (Cannot reconnect: MDL is not closed)
  12-15 16:41:00.044: E/BluetoothHealthProfileHandler(147): Error
  obtaining fd for channel:/org/bluez/278/hci0/dev_00_80_25_14_A1_BC/
  chan3115
  12-15 16:41:00.074: E/BluetoothService.cpp(147): destroyChannelNative
  12-15 16:41:00.074: E/BluetoothEventLoop.cpp(147):
  onHealthDeviceConnectionResult: D-Bus error:
  org.bluez.Error.HealthError (Mdl is not created)
  12-15 16:41:00.074: D/BluetoothEventLoop(147):
  onHealthDeviceConnectionResult 2 6001
  12-15 16:41:00.214: D/BluetoothEventLoop(147):
  onHealthDeviceConnectionResult 2 6000
  12-15 16:41:00.214: D/BluetoothEventLoop(147): Health Device : Name of
  Property is: MainChannel Value:/org/bluez/278/hci0/
  dev_00_80_25_14_A1_BC/chan3115

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

2012-01-14 Thread Mark Murphy
On Sat, Jan 14, 2012 at 5:21 AM, Dusk Jockeys Android Apps
duskjock...@gmail.com wrote:
 from my point of view the animation is part
 of the functionality, as it is the raison d'etre of the app...

As Ms. Hackborn pointed out, there is no law requiring home screens to
support animations. *Any* home screen, whether written by a device
manufacturer or an independent developer, might elect to suppress your
animations (e.g., a PowerSaver brand home screen that specifically
disables certain things, like app widget animations, to save battery
life).

Hence, from your USP standpoint, you need to de-emphasize animations,
or point out that they work only with compliant home screens.

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

Android Training in NYC: http://marakana.com/training/android/

-- 
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] threading : two independent events

2012-01-14 Thread Mark Murphy
On Sat, Jan 14, 2012 at 1:41 AM, vishal garg vishal17g...@gmail.com wrote:
 I have an android app code where

 1) 1st process : checks for user location constantly after every t
 minutes.
 2) 2nd process : displays an image on the screen

Why are these two processes? 99.99% of Android applications do not
need more than one process. There is nothing in this description that
would justify the cost to the user in CPU, RAM, and battery from your
decision.

 The processes are independent and but the code gets stuck in the first
 process as a result of which second process does not load. I am
 thinking of using threading to resolve but unable to understand/find
 documentation. Please help.

Please ask specific questions, not just please help.

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

Android Training in NYC: http://marakana.com/training/android/

-- 
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: Unable to execute Bluetooth HDP Demo

2012-01-14 Thread jfernandez
Hi Fernando,

I have introduced a change in the implementation of the
BluetoothHealthCallback mHealthCallback. Exactly, in its method
onHealthChannelStateChange(...). I detected that the state machine
during the stablishment of a new HDP connection is: Disconnected-
Connecting-Connected. However, you can see that the example is
checking the case Disconnected-Connected, but not the case Connecting-
Connected. I added this new case Connecting-Connected, and now it
works and I'm able to read/write data from/to UA-767PBT-C and a board
that emulates several biomedical devices.

I hope it help you.

Regards.

On 14 ene, 12:35, Fernando Almeida reala...@gmail.com wrote:
 Hi jfernandez... i upgrade my android version to 4.03 and still can't
 connect...

 Could you please show me the changes that you made?

 Thank you

 On 13 Jan, 10:57, jfernandez jorge.fernandez.gonza...@gmail.com
 wrote:







  Hi again,

  Well, after upgrading my Android 4.0 to 4.03, and adding some changes
  to the BluetoothHDPsample, I'm able to connect to the biomedical
  device, as well as I'm able to read/write data from/to theHDP
  channel. So, it seems the problem has been fixed in this new Android
  version.

  Regards.

  On 15 dic 2011, 18:30, jfernandez jorge.fernandez.gonza...@gmail.com
  wrote:

   Hi all,

   I'm executing theBluetoothHDPDemo [1]  (offered from Android 4.0
   Ice Cream Sandwich) in my Android smartphone. When I have registered
   the application in order to receive data, and I have paired the
   biomedical device with the smartphone, I try to open the channel
   connection and I can see that the device starts sending data to the
   smartphone. However, the smartphone is unable to open the channel
   connectionHDP.

   At the end of this message you can see the output obtained in the
   LogCat.

   Has anybody achieved to run successfully this sample about the use of
   theBluetoothHealth Profile API? Any ideas?

   Thanks. Regards.

   [1]http://developer.android.com/resources/samples/BluetoothHDP/index.html

   This is the log that I obtain:

   12-15 16:40:54.048: I/BluetoothHDPService(1105): connectChannel()
   12-15 16:40:54.068: D/BluetoothService(147): CONNECTION_STATE_CHANGE:
   00:80:25:14:A1:BC: 0 - 1
   12-15 16:40:55.169: D/ConnectivityService(147):
   handleInetConditionHoldEnd: net=1, condition=0, published condition=0
   12-15 16:40:59.393: D/BluetoothEventLoop(147): Device property
   changed: 00:80:25:14:A1:BC property: Connected value: true
   12-15 16:41:00.024: D/BluetoothEventLoop(147): Health Device :
   devicePath: /org/bluez/278/hci0/dev_00_80_25_14_A1_BC:channelPath:/org/
  bluez/278/hci0/dev_00_80_25_14_A1_BC/chan3115:existstrue
   12-15 16:41:00.034: E/BluetoothService.cpp(147):
   getChannelApplicationNative
   12-15 16:41:00.044: E/bluetooth_common.cpp(147):
   dbus_func_args_timeout_valist: D-Bus error in Acquire:
   org.bluez.Error.HealthError (Cannot reconnect: MDL is not closed)
   12-15 16:41:00.044: E/BluetoothHealthProfileHandler(147): Error
   obtaining fd for channel:/org/bluez/278/hci0/dev_00_80_25_14_A1_BC/
   chan3115
   12-15 16:41:00.074: E/BluetoothService.cpp(147): destroyChannelNative
   12-15 16:41:00.074: E/BluetoothEventLoop.cpp(147):
   onHealthDeviceConnectionResult: D-Bus error:
   org.bluez.Error.HealthError (Mdl is not created)
   12-15 16:41:00.074: D/BluetoothEventLoop(147):
   onHealthDeviceConnectionResult 2 6001
   12-15 16:41:00.214: D/BluetoothEventLoop(147):
   onHealthDeviceConnectionResult 2 6000
   12-15 16:41:00.214: D/BluetoothEventLoop(147): Health Device : Name of
   Property is: MainChannel Value:/org/bluez/278/hci0/
   dev_00_80_25_14_A1_BC/chan3115

-- 
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] Geo coder not provides exact location

2012-01-14 Thread lbendlin
Read the documentation about RequestLocationUpdates parameters. Clean up your 
code, remove duplicate instructions (you unregister twice) .

-- 
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] Location extraction from cell ID returned

2012-01-14 Thread lbendlin
The cells certainly know where YOU are based on the antenna sector and power 
level. Do you see any of that data on the device?

-- 
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] OnDraw for whole screen

2012-01-14 Thread Hydro Misco
I am trying to draw a simple shape on whatever is on the screen - say
a filled rectangle.

I suspect I need to somehow get access to the OnDraw for the whole
screen.

  * How do i do this?

I need to do this with everything else running as normal... i.e. there
should be a box that constantly appears over everything else. One
should be able to click through the box.

I would love any help with this. Thank you.

-- 
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] OnDraw for whole screen

2012-01-14 Thread Mark Murphy
On Sat, Jan 14, 2012 at 8:56 AM, Hydro Misco niranpaud...@gmail.com wrote:
 I am trying to draw a simple shape on whatever is on the screen - say
 a filled rectangle.

 I suspect I need to somehow get access to the OnDraw for the whole
 screen.

  * How do i do this?

Your activity can retrieve any of its widgets via findViewById().
Though only lightly documented, android.R.id.content is the widget ID
for your activity's content view (or, more accurately, the FrameLayout
into which Android loads your content view).

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

Android Training in NYC: http://marakana.com/training/android/

-- 
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: gps waiting problem.

2012-01-14 Thread James Black
I often send emails from my phone, but good writing is still important.
On Jan 13, 2012 9:26 PM, Dhaval Varia dhavalkva...@gmail.com wrote:

 Jst bcoz i m sending email from my mobile
 Thanks for reply.
 On Jan 14, 2012 12:38 AM, Spiral123 cumis...@gmail.com wrote:

 wh d u kp drppng ltrs?

 I thnk ths pst answrs ur que:
 http://stackoverflow.com/questions/5895283/locationlistener-and-timers



 On Jan 13, 12:24 pm, Dhaval Varia dhavalkva...@gmail.com wrote:
  my que is
 
  in this code locationmanager.removeupdate() Has called, but still
  getaddress() is calling for few times.
 
  i think after locatiomanager.removeupdate() ,
  onlocationchange() should mot call.right?
 
  bt it is calling.
 
  inturn,
  getaddress() is calling for few time.
 
  I want that getaddress()
  should not call after having address,based on lat-long.
 
  What to do?
  On Jan 13, 2012 10:38 PM, Dhaval Varia dhavalkva...@gmail.com
 wrote:
 
 
 
 
 
 
 
   my que is
 
   in this code
   locationmanager.removeupdate
   Has called but getaddress is calling few time.
 
   i think after remove it,
   onlocationchange should mot call.right?
 
   bt it call.
 
   inturn,getaddress is calling for few time.
 
   I dnt want to call after having address from lat-long.
 
   What to do?
   On Jan 13, 2012 10:17 PM, Spiral123 cumis...@gmail.com wrote:
 
   that is not a snippet.
 
Problem is :
 
1. UpdateRemove doesn't work.
 
   I can't see any reference to 'UpdateRemove' in your code.  what is
 the
   error in the LogCat and what line of code does it happen at?
 
2. I need to do following thing :
- Get Address Once (By calling getaddress()),
- After Getting Address,UpdataLocation function should not
call. -- so, Address will setOnce
Timer should stop
Application Finish() / Close
 
   errr...well that is a statement, not a question.  What is your
   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

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

Fwd: [android-developers] Real-time video streaming/disabling or configuring MediaPlayer caching-buffering

2012-01-14 Thread Brad O'Hearne
Giving this a last bump in hopes of a response...any ideas or otherwise not 
commonly known or documented information on the Android MediaPlayer would be 
extremely welcome. 

Thanks, 

Brad

Brad O'Hearne
Founder / Lead Developer
Big Hill Software LLC
http://www.bighillsoftware.com

Begin forwarded message:

 From: Brad O'Hearne br...@bighillsoftware.com
 Subject: [android-developers] Real-time video streaming/disabling or 
 configuring MediaPlayer caching-buffering
 Date: January 11, 2012 2:05:05 PM MST
 To: Android Developers android-developers@googlegroups.com
 Reply-To: android-developers@googlegroups.com
 
 Hello, 
 
 I am trying to play a real-time video stream with the Android MediaPlayer. 
 The use case prioritizes real-time rendering to the screen over smooth 
 playback. Restated, I am not interested in smooth un-interrupted playback 
 such as watching a movie or YouTube video or webcast, where video is 
 typically buffered, if even minimally, to achieve smooth playback. What I 
 need to do is eliminate as much latency as possible between the video source 
 stream and playback, so that the delay between a direct rendering at the 
 source and the playback of the stream on an Android tablet is as small as 
 possible. Presently, I have an app which plays an RTSP stream with the 
 MediaPlayer, and I'm encountering a latency of around 4 seconds, which is 
 unacceptable for this use case. I am seeking 1 second latency. 
 
 I have been looking high and low for any way to configure the MediaPlayer, 
 and it doesn't appear that there are really any knobs or switches on it to 
 adjust. Specifically what I'd like to do is the following: 
 
 1. Adjust or disable entirely caching and buffering within the MediaPlayer. 
 
 2. Tell the MediaPlayer to ignore any processing for audio, which is not 
 needed in this use case. 
 
 3. Potentially be able to control or monitor the network transport of the 
 stream (much less important than #1). 
 
 4. It would be great to be able to get some statistical data on what part of 
 the pipeline latency exists: network transport, buffering, decoding, 
 rendering, etc. (again, much less important than #1). 
 
 If anyone has any ideas or suggestions for the above, I'd really appreciate 
 it. Even alternative solutions for accomplishing the need are welcome (though 
 this is a commercial application, and so GPL source isn't an alternative), 
 though the ideal solution would be to leverage the native MediaPlayer. 
 
 Thanks in advance for your assistance.
 
 Regards, 
 
 Brad
 
 Brad O'Hearne
 Founder / Lead Developer
 Big Hill Software LLC
 http://www.bighillsoftware.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

-- 
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] Real-time video streaming/disabling or configuring MediaPlayer caching-buffering

2012-01-14 Thread Mark Murphy
On Sat, Jan 14, 2012 at 11:45 AM, Brad O'Hearne
br...@bighillsoftware.com wrote:
 1. Adjust or disable entirely caching and buffering within the MediaPlayer.

 2. Tell the MediaPlayer to ignore any processing for audio, which is not
 needed in this use case.

 3. Potentially be able to control or monitor the network transport of the
 stream (much less important than #1).

 4. It would be great to be able to get some statistical data on what part of
 the pipeline latency exists: network transport, buffering, decoding,
 rendering, etc. (again, much less important than #1).

AFAIK, nothing of what you seek is supported from the SDK.

I haven't checked out the NDK's ability to work directly with the
screen recently -- I know it can do OpenGL, but I'm not sure if a
push buffers-style approach is possible. If it is, you might be able
to use the NDK to roll your own streaming mechanism that meets your
requirements.

Also, if this is for custom hardware, all you seek should be possible
via custom firwmare, albeit perhaps sans much documentation.

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

Android Training in NYC: http://marakana.com/training/android/

-- 
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] Real-time video streaming/disabling or configuring MediaPlayer caching-buffering

2012-01-14 Thread Brad O'Hearne
Mark, 

Thanks for the reply. That's pretty much what I suspected -- I'll check out the 
NDK. 

Brad

Brad O'Hearne
Founder / Lead Developer
Big Hill Software LLC
http://www.bighillsoftware.com

On Jan 14, 2012, at 9:52 AM, Mark Murphy wrote:

 On Sat, Jan 14, 2012 at 11:45 AM, Brad O'Hearne
 br...@bighillsoftware.com wrote:
 1. Adjust or disable entirely caching and buffering within the MediaPlayer.
 
 2. Tell the MediaPlayer to ignore any processing for audio, which is not
 needed in this use case.
 
 3. Potentially be able to control or monitor the network transport of the
 stream (much less important than #1).
 
 4. It would be great to be able to get some statistical data on what part of
 the pipeline latency exists: network transport, buffering, decoding,
 rendering, etc. (again, much less important than #1).
 
 AFAIK, nothing of what you seek is supported from the SDK.
 
 I haven't checked out the NDK's ability to work directly with the
 screen recently -- I know it can do OpenGL, but I'm not sure if a
 push buffers-style approach is possible. If it is, you might be able
 to use the NDK to roll your own streaming mechanism that meets your
 requirements.
 
 Also, if this is for custom hardware, all you seek should be possible
 via custom firwmare, albeit perhaps sans much documentation.
 
 -- 
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy
 
 Android Training in NYC: http://marakana.com/training/android/
 
 -- 
 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: OnDraw for whole screen

2012-01-14 Thread Mark Murphy
Replying back to the list, where this belongs:

On Sat, Jan 14, 2012 at 12:22 PM, Hydro Misco niranpaud...@gmail.com wrote:
 Hey Mark,

 Thanks for answering this question for me - I dont quite understand it
 though.

 can you perhaps point me to an online sample?

  I just need to
 understand the fundamentals, namely, is it possible to have a formless
 application that will draw over whatever is on screen? I need it to do
 it constantly.

I am most certainly not going to help you with that. There is a way to
do it, but it involves techniques that IMHO are security flaws in
Android, though Google disagrees with me on that point.

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

Android Training in NYC: http://marakana.com/training/android/

-- 
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] Continuously running Service does not run continuously

2012-01-14 Thread Dirk
Hi,
I am writing a service which shall continuously log some sensor data
over longer periods of time. For testing purposes the service shall
log a static debug message once every second. Looking at the log file,
after some time (usually 30min to several hours), the logging only
takes place every 10 minutes, every half an hour or sometimes even
only once an hour. When I connect the phone to my computer, the
service starts logging every second again.

There are already some posts dealing with the same problem, but I did
not find an appropriate answer. Maybe someone can help to clarify ?

Here are some details of the implementation:

The service is started once the device completed its boot process (or
once the corresponding activity is launched) using:

Intent serviceIntent = new Intent(getApplicationContext(),
TestService.class);
startService(serviceIntent);

The service itself overrides onStartCommand() with

public int onStartCommand(Intent intent, int flags, int startId)
{
return START_STICKY;
}

so that the service shall be restarted if Android decides to stop it.
And in the onCreate method I start a periodic task to log:

Timer timer = new Timer();
timer.schedule(new TimerTask() {
public void run()
{
writeToDebugFile(TestService: Control Message.,
getApplicationContext());
}
}, 0, 1000);

As an alternative I tried to create my own logging-thread, but that
did not help either.
I also tried to let the service run in the foregound using

startForeground(334, myNotification);

without success.

I tested the implementation with an out-of-the-box Nexus Prime, with
no other apps installed or running.

Just in case someone wants to replay the problem, an eclipse export of
a minimal test case can be downloaded here:

http://www.hyfy.de/temp/ContinuousServiceTest.zip

Thanks for any comments !
Regards Dirk

-- 
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] Directory structure for project related files

2012-01-14 Thread nadam
All of my android projects usually have a /tmp folder where I dump all
the stuff that isn't necessary for building the apk, such as psd/xcf
files, the 512x512 icon, screenshots and the signed apk that will be
uploaded to the market.

I'm also considering adding these files to my version control just to
make sure I have all the files in one place and to have them backed
up.

Are there any best practices for organizing such files? Or has anyone
any suggestions or personal preferences to share?

-- 
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] Continuously running Service does not run continuously

2012-01-14 Thread Mark Murphy
On Sat, Jan 14, 2012 at 12:43 PM, Dirk b...@informatik.uni-hamburg.de wrote:
 I am writing a service which shall continuously log some sensor data
 over longer periods of time. For testing purposes the service shall
 log a static debug message once every second. Looking at the log file,
 after some time (usually 30min to several hours), the logging only
 takes place every 10 minutes, every half an hour or sometimes even
 only once an hour. When I connect the phone to my computer, the
 service starts logging every second again.

That is because the phone is falling asleep. Users like it when their
phone falls asleep, as this maximizes battery life.

 The service is started once the device completed its boot process (or
 once the corresponding activity is launched) using:

 Intent serviceIntent = new Intent(getApplicationContext(),
 TestService.class);
 startService(serviceIntent);

You do not need getApplicationContext() here. Please replace it with
the this object reference.

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

Android Training in NYC: http://marakana.com/training/android/

-- 
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] Directory structure for project related files

2012-01-14 Thread Mark Murphy
I wouldn't call it tmp/, as that would make me think of Linux and OS X
/tmp, which are files that can be deleted without incident. I've used
various other directory names for stuff like this (e.g., artwork/,
misc/). If assets/ weren't already used by Android for another role, I
would probably have settled on that. But I do like having it
co-located with the rest of the project files, and in version control,
for the same reasons you do.

On Sat, Jan 14, 2012 at 12:44 PM, nadam a...@anyro.se wrote:
 All of my android projects usually have a /tmp folder where I dump all
 the stuff that isn't necessary for building the apk, such as psd/xcf
 files, the 512x512 icon, screenshots and the signed apk that will be
 uploaded to the market.

 I'm also considering adding these files to my version control just to
 make sure I have all the files in one place and to have them backed
 up.

 Are there any best practices for organizing such files? Or has anyone
 any suggestions or personal preferences to share?

 --
 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/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in NYC: http://marakana.com/training/android/

-- 
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: Continuously running Service does not run continuously

2012-01-14 Thread Dirk
Thank you Mark !
Is there a way to control the device's sleep phases programmatically,
so I can make sure the logging really takes place ?

Regards Dirk

On 14 Jan., 18:48, Mark Murphy mmur...@commonsware.com wrote:
 On Sat, Jan 14, 2012 at 12:43 PM, Dirk b...@informatik.uni-hamburg.de wrote:
  I am writing a service which shall continuously log some sensor data
  over longer periods of time. For testing purposes the service shall
  log a static debug message once every second. Looking at the log file,
  after some time (usually 30min to several hours), the logging only
  takes place every 10 minutes, every half an hour or sometimes even
  only once an hour. When I connect the phone to my computer, the
  service starts logging every second again.

 That is because the phone is falling asleep. Users like it when their
 phone falls asleep, as this maximizes battery life.

  The service is started once the device completed its boot process (or
  once the corresponding activity is launched) using:

  Intent serviceIntent = new Intent(getApplicationContext(),
  TestService.class);
  startService(serviceIntent);

 You do not need getApplicationContext() here. Please replace it with
 the this object reference.

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

 Android Training in NYC:http://marakana.com/training/android/

-- 
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: Continuously running Service does not run continuously

2012-01-14 Thread Mark Murphy
On Sat, Jan 14, 2012 at 1:00 PM, Dirk b...@informatik.uni-hamburg.de wrote:
 Is there a way to control the device's sleep phases programmatically,
 so I can make sure the logging really takes place ?

Use a WakeLock to keep the CPU running. Your users may not like you
much, though.

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

Android Training in NYC: http://marakana.com/training/android/

-- 
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: Continuously running Service does not run continuously

2012-01-14 Thread Kristopher Micinski
The way you should read mark's response here is:

Don't keep the cpu running, this is a dumb idea, if you're really
doing this it probably indicates there is something wrong with your
design

If this is *strictly* for development, and you'll completely strip out
the code when you release your app, it would probably be fine.

kris

On Sat, Jan 14, 2012 at 1:05 PM, Mark Murphy mmur...@commonsware.com wrote:
 On Sat, Jan 14, 2012 at 1:00 PM, Dirk b...@informatik.uni-hamburg.de wrote:
 Is there a way to control the device's sleep phases programmatically,
 so I can make sure the logging really takes place ?

 Use a WakeLock to keep the CPU running. Your users may not like you
 much, though.

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

 Android Training in NYC: http://marakana.com/training/android/

 --
 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: Continuously running Service does not run continuously

2012-01-14 Thread Dianne Hackborn
Also unless you make your service foreground, its process *will* be killed
every now and then while it is in the background.

And you can use the AlarmManager to avoid holding a wake lock the entire
time, but a rate of once a second is way to fast to be appropriate for that
-- scheduling Alarms should not be in terms of anything quicker than once a
minute and really more like once every 5 minutes or more.

On Sat, Jan 14, 2012 at 11:00 AM, Kristopher Micinski 
krismicin...@gmail.com wrote:

 The way you should read mark's response here is:

 Don't keep the cpu running, this is a dumb idea, if you're really
 doing this it probably indicates there is something wrong with your
 design

 If this is *strictly* for development, and you'll completely strip out
 the code when you release your app, it would probably be fine.

 kris

 On Sat, Jan 14, 2012 at 1:05 PM, Mark Murphy mmur...@commonsware.com
 wrote:
  On Sat, Jan 14, 2012 at 1:00 PM, Dirk b...@informatik.uni-hamburg.de
 wrote:
  Is there a way to control the device's sleep phases programmatically,
  so I can make sure the logging really takes place ?
 
  Use a WakeLock to keep the CPU running. Your users may not like you
  much, though.
 
  --
  Mark Murphy (a Commons Guy)
  http://commonsware.com | http://github.com/commonsguy
  http://commonsware.com/blog | http://twitter.com/commonsguy
 
  Android Training in NYC: http://marakana.com/training/android/
 
  --
  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




-- 
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, and so won't reply to such e-mails.  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

Re: [android-developers] Re: Continuously running Service does not run continuously

2012-01-14 Thread Dianne Hackborn
And to really really re-iterate -- we are still only talking about
non-production code.

On Sat, Jan 14, 2012 at 11:16 AM, Dianne Hackborn hack...@android.comwrote:

 Also unless you make your service foreground, its process *will* be killed
 every now and then while it is in the background.

 And you can use the AlarmManager to avoid holding a wake lock the entire
 time, but a rate of once a second is way to fast to be appropriate for that
 -- scheduling Alarms should not be in terms of anything quicker than once a
 minute and really more like once every 5 minutes or more.


 On Sat, Jan 14, 2012 at 11:00 AM, Kristopher Micinski 
 krismicin...@gmail.com wrote:

 The way you should read mark's response here is:

 Don't keep the cpu running, this is a dumb idea, if you're really
 doing this it probably indicates there is something wrong with your
 design

 If this is *strictly* for development, and you'll completely strip out
 the code when you release your app, it would probably be fine.

 kris

 On Sat, Jan 14, 2012 at 1:05 PM, Mark Murphy mmur...@commonsware.com
 wrote:
  On Sat, Jan 14, 2012 at 1:00 PM, Dirk b...@informatik.uni-hamburg.de
 wrote:
  Is there a way to control the device's sleep phases programmatically,
  so I can make sure the logging really takes place ?
 
  Use a WakeLock to keep the CPU running. Your users may not like you
  much, though.
 
  --
  Mark Murphy (a Commons Guy)
  http://commonsware.com | http://github.com/commonsguy
  http://commonsware.com/blog | http://twitter.com/commonsguy
 
  Android Training in NYC: http://marakana.com/training/android/
 
  --
  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




 --
 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, and so won't reply to such e-mails.  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, and so won't reply to such e-mails.  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

Re: [android-developers] Re: OnDraw for whole screen

2012-01-14 Thread Kristopher Micinski
Just out of curiosity, what would be the non malicious use case you
had in mind here, Hydro?

kris

On Sat, Jan 14, 2012 at 12:41 PM, Mark Murphy mmur...@commonsware.com wrote:
 Replying back to the list, where this belongs:

 On Sat, Jan 14, 2012 at 12:22 PM, Hydro Misco niranpaud...@gmail.com wrote:
 Hey Mark,

 Thanks for answering this question for me - I dont quite understand it
 though.

 can you perhaps point me to an online sample?

  I just need to
 understand the fundamentals, namely, is it possible to have a formless
 application that will draw over whatever is on screen? I need it to do
 it constantly.

 I am most certainly not going to help you with that. There is a way to
 do it, but it involves techniques that IMHO are security flaws in
 Android, though Google disagrees with me on that point.

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

 Android Training in NYC: http://marakana.com/training/android/

 --
 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] Logcat is broken every time phone is unplugged

2012-01-14 Thread Keith Wiley
Every time the phone is unplugged from USB, the logcat is permanently
corrupted in that the when the phone is reconnected, logcat does not
reestablish.  Restarting an app, either in debug or run mode produces
zero logcat output after that point.  Closing the logcat window view
and reopening it has no effect.  The only solution is to quit and
restart Eclipse.  Therefore, I must quit and restart Eclipse every
time I take my phone with me and then later return.

I've been having this problem since day one with Android development,
three years ago.  In that time I have installed new versions of
Eclipse and numerous updates to the Android SDK and Eclipse plugin.
Nothing has ever improved the situation w.r.t. this bug.

Anyone know anything about this?

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] Logcat is broken every time phone is unplugged

2012-01-14 Thread Mark Murphy
I haven't seen that on any of my devices. What's the phone?

On Sat, Jan 14, 2012 at 3:24 PM, Keith Wiley kbwi...@gmail.com wrote:
 Every time the phone is unplugged from USB, the logcat is permanently
 corrupted in that the when the phone is reconnected, logcat does not
 reestablish.  Restarting an app, either in debug or run mode produces
 zero logcat output after that point.  Closing the logcat window view
 and reopening it has no effect.  The only solution is to quit and
 restart Eclipse.  Therefore, I must quit and restart Eclipse every
 time I take my phone with me and then later return.

 I've been having this problem since day one with Android development,
 three years ago.  In that time I have installed new versions of
 Eclipse and numerous updates to the Android SDK and Eclipse plugin.
 Nothing has ever improved the situation w.r.t. this bug.

 Anyone know anything about this?

 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



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

Android Training in NYC: http://marakana.com/training/android/

-- 
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: Logcat is broken every time phone is unplugged

2012-01-14 Thread Keith Wiley
G1, OS 1.6
Eclipse Helious
I'm part way through installing Android SDK rev 16, but like I said,
this has been persistent across a variety of versions of all the
associated pieces.

I don't understand why I haven't seen more reports of this.

Thanks for any help.

On Jan 14, 12:27 pm, Mark Murphy mmur...@commonsware.com wrote:
 I haven't seen that on any of my devices. What's the phone?









 On Sat, Jan 14, 2012 at 3:24 PM, Keith Wiley kbwi...@gmail.com wrote:
  Every time the phone is unplugged from USB, the logcat is permanently
  corrupted in that the when the phone is reconnected, logcat does not
  reestablish.  Restarting an app, either in debug or run mode produces
  zero logcat output after that point.  Closing the logcat window view
  and reopening it has no effect.  The only solution is to quit and
  restart Eclipse.  Therefore, I must quit and restart Eclipse every
  time I take my phone with me and then later return.

  I've been having this problem since day one with Android development,
  three years ago.  In that time I have installed new versions of
  Eclipse and numerous updates to the Android SDK and Eclipse plugin.
  Nothing has ever improved the situation w.r.t. this bug.

  Anyone know anything about this?

  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

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

 Android Training in NYC:http://marakana.com/training/android/

-- 
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] Fragment view state is getting lost after couple of orientation changes

2012-01-14 Thread ksat8384
I reported an issue but i yet to get the response...
http://code.google.com/p/android/issues/detail?id=24273

FYI: I have attached my complete test project named Fragments in the
above reported issue.

Could you just let me know the best way to save the state of the views
in fragments? because after a couple of fragment replacement, if you
try to do orientation change and come back to previous fragment, the
view state of fragments which is saved in the bundle is lost.

Is that i have to save the state of views in each fragment using the
bundle in onSaveInstanceState() and retrieve it back through
onCreate(), onCreateView(), or onActivityCreated()??? If this is the
case i have already tried it and it doesn't work which i reported as
an issue http://code.google.com/p/android/issues/detail?id=24273;

(OR)

Is that I need to save the state of each views in each fragment in the
Activity itself?? If this is the case, then it will be a huge task to
save each and every views in each fragment to be saved in activity and
i think this will be crazy.

I googled for it and found a link which says a solution for it, but
it's not using the bundle functionality to restore the view state,
which you could find in the below link.

http://stackoverflow.com/questions/8260451/fragment-backstack-bug-when-replacing-fragments-in-a-transaction

Hope you got what i am looking for.

-- 
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: Logcat is broken every time phone is unplugged

2012-01-14 Thread Mark Murphy
On Sat, Jan 14, 2012 at 3:35 PM, Keith Wiley kbwi...@gmail.com wrote:
 G1, OS 1.6
 Eclipse Helious
 I'm part way through installing Android SDK rev 16, but like I said,
 this has been persistent across a variety of versions of all the
 associated pieces.

 I don't understand why I haven't seen more reports of this.

I just dusted off my G1 and I cannot reproduce your problem. When I
unplug and re-plug in the G1, LogCat shows all the old entries, plus
any new ones from whatever app I run.

Perhaps try a different micro USB cable.

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

Android Training in NYC: http://marakana.com/training/android/

-- 
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] Extremely odd Canvas Paint Vector Problem

2012-01-14 Thread JamesColeman
I am having a really odd problem that works for somethings but not
others. It feels more like a bug than a code problem to me.

I  have tried may different approaches. However, I think the following
sums up the issue in it's simplest form. It does not represent the
code I want to use in my  application.  It is only to test this
problem.

If I use the following code and draw on my Canvas using a Paint
variable it works

TestPaint1 = new Paint();
TestPaint1.setAntiAlias(true);
TestPaint1.setTextSize(CurrentTextSize);
TestPaint1.setDither(true);
TestPaint1.setColor(CurrentColor);
TestPaint1.setStyle(Paint.Style.STROKE);
TestPaint1.setStrokeJoin(Paint.Join.ROUND);
TestPaint1.setStrokeCap(Paint.Cap.ROUND);
TestPaint1.setStrokeWidth(CurrentLineWidth);

I also use the above code to create TestPaint2 and TestPaint3


DrawingCanvas  = getHolder().lockCanvas();
DrawingCanvas.drawLines

If I use the following code Canvas.drawCircle() and
Canvas.drawOval()work, but drawLine,drawRect, etc do NOT work.


public Paint CreatePaint(){
Paint TempPaint = new Paint();
TempPaint.setAntiAlias(true);
TempPaint.setTextSize(CurrentTextSize);
TempPaint.setDither(true);
TempPaint.setColor(CurrentColor);
TempPaint.setStyle(Paint.Style.STROKE);
TempPaint.setStrokeJoin(Paint.Join.ROUND);
TempPaint.setStrokeCap(Paint.Cap.ROUND);
TempPaint.setStrokeWidth(CurrentLineWidth);
return TempPaint;
}

Vector PaintVector

-- 
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: Extremely odd Canvas Paint Vector Problem

2012-01-14 Thread JamesColeman
I am having a horrible day. This was NOT supposed to post yet. Please
ignore and  I will try to delete it.

On Jan 14, 2:37 pm, JamesColeman jamescole...@radicalphotography.com
wrote:
 I am having a really odd problem that works for somethings but not
 others. It feels more like a bug than a code problem to me.

 I  have tried may different approaches. However, I think the following
 sums up the issue in it's simplest form. It does not represent the
 code I want to use in my  application.  It is only to test this
 problem.

 If I use the following code and draw on my Canvas using a Paint
 variable it works

         TestPaint1 = new Paint();
         TestPaint1.setAntiAlias(true);
         TestPaint1.setTextSize(CurrentTextSize);
         TestPaint1.setDither(true);
         TestPaint1.setColor(CurrentColor);
         TestPaint1.setStyle(Paint.Style.STROKE);
         TestPaint1.setStrokeJoin(Paint.Join.ROUND);
         TestPaint1.setStrokeCap(Paint.Cap.ROUND);
         TestPaint1.setStrokeWidth(CurrentLineWidth);

 I also use the above code to create TestPaint2 and TestPaint3

         DrawingCanvas  = getHolder().lockCanvas();
 DrawingCanvas.drawLines

 If I use the following code Canvas.drawCircle() and
 Canvas.drawOval()work, but drawLine,drawRect, etc do NOT work.

     public Paint CreatePaint(){
         Paint TempPaint = new Paint();
         TempPaint.setAntiAlias(true);
         TempPaint.setTextSize(CurrentTextSize);
         TempPaint.setDither(true);
         TempPaint.setColor(CurrentColor);
         TempPaint.setStyle(Paint.Style.STROKE);
         TempPaint.setStrokeJoin(Paint.Join.ROUND);
         TempPaint.setStrokeCap(Paint.Cap.ROUND);
         TempPaint.setStrokeWidth(CurrentLineWidth);
         return TempPaint;
     }

     Vector PaintVector

-- 
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: Logcat is broken every time phone is unplugged

2012-01-14 Thread Keith Wiley
Hmmm, okay.  I don't have one that fits the G1's connecter, but I'll
consider the suggestion.

Sigh.

On Jan 14, 12:47 pm, Mark Murphy mmur...@commonsware.com wrote:
 Perhaps try a different micro USB cable.

-- 
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: OnDraw for whole screen

2012-01-14 Thread Hydro Misco
I am trying to make an app that applies a particular 'filter over
screen contents e.g. sapia.

Nothing sinister.

On Jan 14, 7:26 pm, Kristopher Micinski krismicin...@gmail.com
wrote:
 Just out of curiosity, what would be the non malicious use case you
 had in mind here, Hydro?

 kris



 On Sat, Jan 14, 2012 at 12:41 PM, Mark Murphy mmur...@commonsware.com wrote:
  Replying back to the list, where this belongs:

  On Sat, Jan 14, 2012 at 12:22 PM, Hydro Misco niranpaud...@gmail.com 
  wrote:
  Hey Mark,

  Thanks for answering this question for me - I dont quite understand it
  though.

  can you perhaps point me to an online sample?

   I just need to
  understand the fundamentals, namely, is it possible to have a formless
  application that will draw over whatever is on screen? I need it to do
  it constantly.

  I am most certainly not going to help you with that. There is a way to
  do it, but it involves techniques that IMHO are security flaws in
  Android, though Google disagrees with me on that point.

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

  Android Training in NYC:http://marakana.com/training/android/

  --
  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] Navigation Tabs converted to Drop down on orientation change in Action bar of ICS.

2012-01-14 Thread Mark Murphy
Can you post a sample project that demonstrates your problem?

On Fri, Jan 13, 2012 at 6:32 AM, Sudeep Sharma sudeep.andr...@gmail.com wrote:
 Hi Guys,

 I have a query related to Action bar in ICS.

 As we all know Action bar supports both mode , 1. Navigation Tabs 2.
 Drop-down Navigation.

 I have an Activity with Action bar and added Navigation Tabs such that
 each Tab text is lengthy. (say TAB1, TAB2, TAB3,
 TAB4. etc...) So the view i will be seeing in the portrait mode
 will be as shown in snapshot_portrait.png which is attached with this
 email. If the Tab doesn't fit in Portrait mode, the desired tab can be
 reached by fling action.

 Now changing the orientation, the Tabbed view changes to a drop down
 if all the tabs doesnt fit the entire landscape view width.

 I wanted to have the same Tabbed views in landscape mode too where
 fling action can slide the tabs..

 Please can anybody let me know how can i achieve this.

 Appreciate your quick reply.

 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



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

Android Training in NYC: http://marakana.com/training/android/

-- 
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: Directory structure for project related files

2012-01-14 Thread RLScott
Can we be sure that any randomly named directory added to the project
folder is not going to be included in the app package? For instance,
the folder named assets does get included, but misc does not?

-- 
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: Directory structure for project related files

2012-01-14 Thread Mark Murphy
On Sat, Jan 14, 2012 at 7:11 PM, RLScott fixthatpi...@yahoo.com wrote:
 Can we be sure that any randomly named directory added to the project
 folder is not going to be included in the app package? For instance,
 the folder named assets does get included, but misc does not?

AFAIK, only well-defined directories like assets/, res/, src/, and
libs/ will contribute to the APK contents. To put it another way,
there's no point in putting it into the APK if we can't read it out.

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

Android Training in NYC: http://marakana.com/training/android/

-- 
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] Package name

2012-01-14 Thread yves...@gmail.com
I have an app in the market already. the package name, by mistake, is
com.android.AAA, now, i want to change to my company name YYY.BBB, is
that possible? Will market allow updates changing package 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: Android fragmentation study

2012-01-14 Thread Christopher Van Kirk


Hi Diane!

From your response I sense that I must have touched a nerve. Please 
don't misunderstand my intentions in making these assertions. I'm not an 
Android hater, I'm a disillusioned believer. I'm not the only one though:


http://techcrunch.com/2012/01/14/ok-mg-i-take-it-back/

http://www.zdnet.com/blog/open-source/androids-biggest-worry-fragmentation/8022

On 1/12/2012 4:26 PM, Dianne Hackborn wrote:
On Wed, Jan 11, 2012 at 8:31 PM, Christopher Van Kirk 
christopher.vank...@gmail.com mailto:christopher.vank...@gmail.com 
wrote:


Making software is a business. An investment. To reap maximum
rewards on that investment the product has to have as much reach
as possible, meaning the OP is absolutely on point about OS
upgrades. Who is going to spend 10k, 100k, 1m, etc, developing an
app whose target market is less than 1% of active installs? 4.0
won't be an attractive target for developers until it commands at
least 80% of the installed market, which will likely take at least
a year to occur, perhaps longer.


How different is this from a new major version of Windows coming out? 
 It seems like at least a year until they start to get significant 
traction.  Windows does have an advantage in that user can buy a copy 
of the newer OS and install it if some app they want needs it...  but 
as an app developer, requiring a newer version of the OS than the user 
has is probably not likely to get most of those potential users to buy 
and install an upgrade to their entire OS.
I'm not sure what your point is here. Developers have the same dilemma 
in the Windows space, although to be fair, the changes from version to 
version are far less frequent and far less dramatic than what's 
happening in the Android space. Even so, something like 40% of the PC 
market is still on XP even though it's now 11 years old and beyond its 
support lifetime.


But since you brought it up, you're right. Windows releases generally 
require some time to be adopted. I don't think that refutes the OPs 
point in any way. Also, Windows isn't your competition in the mobile 
space, iOS is, and iOS does not suffer from this problem.


As for what's different, I guess the major thing is that with Windows 
the end user can install the new OS whenever they want to, even on old 
hardware. There's always an upgrade path open for them, whereas in most 
of the officially sanctioned Android universe this isn't an option. 
Instead, people are supposed to buy new phones with the new software 
pre-installed on it, and generally that's subsidized with long term 
contracts to keep them locked into the carrier and the device. Sure, 
there is a sizable hacking community that will help the brave and 
technically savvy to bypass the sanctioned update pipeline, but 
depending on them to save your 4.0 exclusive app seems it would be like 
an exceptionally poor business decision. Finally, there's rarely a new 
version of Windows to contend with, whereas with Android we have 
something new every 6 months or so.



Comparing handset differences with browser difference is just
absurd. How many browser versions are there? Five maybe six? An
average Android app has to deal with over 600 different devices
today. That's a difference of 100x. This number is also growing at
an exponential rate, so even if you can manage to test on all of
those devices, in three months you'll probably have to do the same
number again.


You are significantly exaggerating about 600 different devices...  if 
you are going to say that, you could just as well say there are 
hundreds if not thousands of different PCs running windows...  not to 
mention all those different graphics cards and drivers and what-not... 
 crazy!


The Android market tells me that my app is accessible to 600 devices. If 
that's not true then I guess it has a bug.


Again the comparison to Windows. iOS is your competition, not Windows. 
Having said that, though, Windows does run on thousands of 
configurations of hardware, and yes, each of those configurations is a 
different 'PC'. It's also much more stable and predictable in doing so 
than Android seems to be. I know that comes at the expense of a larger 
OS, but honestly, the phones out there now are getting close in terms of 
capability to the low end PC market anyway.


Yes it is true that there is some more variation between devices 
because of the ability of manufacturers to do customizations...  but 
for the most part this doesn't impact apps (see below), and for those 
situation when it does you are looking at 3 or 4 major manufacturers 
with their own customizations, not 600.


Few manufacturers doesn't mean few implementations of the OS, 
unfortunately. I personally have seen different devices from the same 
manufacturer have different behaviors in various places.



What you're apparently not appreciating is that unlike the PC/Mac
world, the Android world lacks strong compatibility 

[android-developers] Regarding screen orientation changes

2012-01-14 Thread Jay SB
Hi All,

As far as i know, screen orientation can be changed by two ways, one is
through Manifesto file and other is through code by setRequestedOrientation
API.

My requirement is to show the screen orientation in Landscape mode, only
when it launched through one particular application.

To satisfy the above requirement i cannot use the first solution, i.e..
setting the screen orientation through Manifesto file, since it always
launch the activity in the specified orientation. So, now I am forced to
take up the second solution, i.e.. setting the orientation through code by
calling setRequestedOrientation
(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE).

I am facing a problem with this approach, if my tablet is in LANDSCAPE
mode, this solution works perfectly fine. But when my device is in PORTRAIT
mode, initially it launches the activity in PORTRAIT mode and immediately
changes the orientation to LANDSCAPE mode. How this flickering can be
avoided ? Please through some light to handle this requirement.

Manifesto file snippet:

 activity

android:name=.activity.setup.AccountSetup

android:label=@string/account_setup_title

android:theme=@style/AccountSetup

android:configChanges=orientation|keyboardHidden

/activity



Code snippet:

@Override

public void onCreate(Bundle savedInstanceState) {

   super.onCreate(savedInstanceState);

if (App.SETUP_WIZARD_FLOW == true) {


setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);

}

setContentView(R.layout.main);

}
Regards,
Jayantheesh

-- 
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] Package name

2012-01-14 Thread James Black
When you try to change the package name it won't allow an update, so I
believe you are out of luck.
On Jan 14, 2012 7:35 PM, yves...@gmail.com yves...@gmail.com wrote:

 I have an app in the market already. the package name, by mistake, is
 com.android.AAA, now, i want to change to my company name YYY.BBB, is
 that possible? Will market allow updates changing package 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

-- 
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] Regarding screen orientation changes

2012-01-14 Thread James Black
It sounds like your requirements, or understanding is off, so you may want
to check it out.

The confusion is, if you automatically switch to landscape  always then set
it in the manifest.

If you start in portrait mode then why switch them? Or what should happen
differently on this orientation?
On Jan 14, 2012 9:20 PM, Jay SB jsb.andr...@gmail.com wrote:

 Hi All,

 As far as i know, screen orientation can be changed by two ways, one is
 through Manifesto file and other is through code by setRequestedOrientation
 API.

 My requirement is to show the screen orientation in Landscape mode, only
 when it launched through one particular application.

 To satisfy the above requirement i cannot use the first solution, i.e..
 setting the screen orientation through Manifesto file, since it always
 launch the activity in the specified orientation. So, now I am forced to
 take up the second solution, i.e.. setting the orientation through code by
 calling setRequestedOrientation
 (ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE).

 I am facing a problem with this approach, if my tablet is in LANDSCAPE
 mode, this solution works perfectly fine. But when my device is in PORTRAIT
 mode, initially it launches the activity in PORTRAIT mode and immediately
 changes the orientation to LANDSCAPE mode. How this flickering can be
 avoided ? Please through some light to handle this requirement.

 Manifesto file snippet:

  activity

 android:name=.activity.setup.AccountSetup

 android:label=@string/account_setup_title

 android:theme=@style/AccountSetup

 android:configChanges=orientation|keyboardHidden

 /activity



 Code snippet:

 @Override

 public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

 if (App.SETUP_WIZARD_FLOW == true) {


 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);

 }

 setContentView(R.layout.main);

 }
 Regards,
 Jayantheesh

 --
 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] Regarding screen orientation changes

2012-01-14 Thread Jay SB
James,

Thanks for your response.

I am working on Email application, my requirement is to show all the screen
orientation only in landscape mode irrespective of device orientation, only
when it launched through one particular application (Application X). If i
launch the Email app through some other applications (Application y and z),
it should always follow the device orientation.

So, to satisfy the above requirement, when Email application is  launched
from Application x,  i have used the API setRequestedOrientation
(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) to change the
orientation. When my device is PORTRAIT mode, and when its launched through
Application X, all the Email screens are initially launched in PORTRAIT
(Device orientation )mode and then its switching back to LANDSCAPE mode
(because of the above API). How to avoid this screen flickering ?

Hope you will understand my problem.

Regards,
Jayantheesh

On Sat, Jan 14, 2012 at 9:51 PM, James Black planiturth...@gmail.comwrote:

 It sounds like your requirements, or understanding is off, so you may want
 to check it out.

 The confusion is, if you automatically switch to landscape  always then
 set it in the manifest.

 If you start in portrait mode then why switch them? Or what should happen
 differently on this orientation?
 On Jan 14, 2012 9:20 PM, Jay SB jsb.andr...@gmail.com wrote:

 Hi All,

 As far as i know, screen orientation can be changed by two ways, one is
 through Manifesto file and other is through code by setRequestedOrientation
 API.

 My requirement is to show the screen orientation in Landscape mode, only
 when it launched through one particular application.

 To satisfy the above requirement i cannot use the first solution, i.e..
 setting the screen orientation through Manifesto file, since it always
 launch the activity in the specified orientation. So, now I am forced to
 take up the second solution, i.e.. setting the orientation through code by
 calling setRequestedOrientation
 (ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE).

 I am facing a problem with this approach, if my tablet is in LANDSCAPE
 mode, this solution works perfectly fine. But when my device is in PORTRAIT
 mode, initially it launches the activity in PORTRAIT mode and immediately
 changes the orientation to LANDSCAPE mode. How this flickering can be
 avoided ? Please through some light to handle this requirement.

 Manifesto file snippet:

  activity

 android:name=.activity.setup.AccountSetup

 android:label=@string/account_setup_title

 android:theme=@style/AccountSetup

 android:configChanges=orientation|keyboardHidden

 /activity



 Code snippet:

 @Override

 public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

 if (App.SETUP_WIZARD_FLOW == true) {


 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);

 }

 setContentView(R.layout.main);

 }
 Regards,
 Jayantheesh

 --
 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: Package name

2012-01-14 Thread Ricardo Amaral
No, Market doesn't allow that. Here's what you could do instead:

Publish your app under the new company/package name and wait for it to be 
live. Once that's done, publish an update to your older app. That update 
should simply change the app into redirecting users to the new app on the 
Market and politely apologize for the inconvenience and ask them to remove 
the old app after installing the new one. You could also detect the old app 
when running the new one and, if found, suggest the user to uninstall it.

You need to be careful though with the user data though. You should provide 
means for them to migrate that data from the old app to the new one *BEFORE 
UNINSTALLING IT* or they'll lose everything. Maybe an export/import 
procedure will do the job. If you do it right, it only takes a few seconds 
for them to export all the data from the old app and import it into the new 
one.

-- 
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 implement scrolling for custom layout?

2012-01-14 Thread harvinder
I am trying to develop a custom ViewGroup to implement sort of a gantt 
chart with vertical and horizontal scrolling.

So I went about the job and implemented following view

I find following issues with this code.

[1] when onScroll is called I see some flicker and not been able 
to successfully use _scroller.startScroll 
[2] while scrolling onMeasure and onLayout rely on _scroller to get the 
correct scrolling positions, however since there is some delay between 
onMeasure and onLayout, _scroller would provide different values for 
_scroller.getCurrX() and_scroller.getCurrY()in both the functions.So 
measure and layout may easily go out of sync.

How do I solve these two issues? For two I can think of implementing 
onMeasure and onLayout in the same method say in onLayout or in onLayout 
use the scroller position that is measured in onMeasure.

For [1] if I use view's scrollBy, I see there is no flickers but it calls 
invalidate internally and onMeasure and onLayout will not be called and my 
view will not get a layout refresh.

Any help would be greatly appreciated. 


package com.example.android.layout;

import android.content.Context;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.GestureDetector.OnGestureListener;
import android.view.MotionEvent;
import android.view.ViewGroup;
import android.widget.Scroller;

public class CustomView extends ViewGroup implements OnGestureListener {

private GestureDetector gestureScanner;

private Scroller _scroller;
private int _viewPortX, _viewPortY;
public CustomView(Context context, AttributeSet attrs) {
super(context, attrs);
gestureScanner = new GestureDetector(this);
_scroller = new Scroller(this.getContext());

}


@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
// add a child view from adapter (if view is not already present and
// needs to be shown)
// remove unwanted views
// called measure on children
// call setMeasuredDimension((widthMeasureSpec), (heightMeasureSpec));
}

@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
// Layout children here
// ...

if (_scroller.computeScrollOffset()) {
scrollNow(_scroller.getCurrX(), _scroller.getCurrY());

/* This is necessary to request layout while in layout loop */
post(new Runnable() {
public void run() {
requestLayout();
}
});
}
}

@Override
public boolean onTouchEvent(MotionEvent me) {
return gestureScanner.onTouchEvent(me);
}

public void scrollNow(float x, float y) {
_viewPortX = (int) x;
_viewPortY = (int) y;
requestLayout();
}

@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float 
velocityX,float velocityY) {
_scroller.fling(_viewPortX, _viewPortY, (int) velocityX, (int) velocityY,
0, _maxX, 0, _maxY);
requestLayout();

return true;
}

@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
float distanceY) {

// doing this and not reliying on scroller, and no call to 
_scroller.startScroll
int scrollToX = _viewPortX - (int) distanceX;
scrollToX = Math.min(scrollToX, _maxX);
scrollToX = Math.max(scrollToX, 0);

int scrollToY = _viewPortY - (int) distanceY;
scrollToY = Math.min(scrollToY, _maxY);
scrollToY = Math.max(scrollToY, 0);

scrollNow(scrollToX, scrollToY);

return true;
}

@Override
public boolean onDown(MotionEvent e) {
// TODO Auto-generated method stub
return true;
}

@Override
public void onShowPress(MotionEvent e) {
// TODO Auto-generated method stub
 }

@Override
public boolean onSingleTapUp(MotionEvent e) {
// TODO Auto-generated method stub
return false;
}


@Override
public void onLongPress(MotionEvent e) {
// TODO Auto-generated method stub
 }

}
 

Thanks
harvinder

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

2012-01-14 Thread Dusk Jockeys Android Apps
Hi Mark,

Yes, I understand that this is the position I am in, and I have to
adapt to that.

My point was more that although there is no explicit law requiring
home screens to support animations, from my reading of the CTD there
is also no explicit law requiring views in normal Activities to
support animations, but I think there would be a lot of complaints
from developers if those kind of animations suddenly stopped working
in the latest handsets.

But having said that I realise I am on shaky ground here... as we are
talking about homescreen apps which are not part of the framework per
se. However, from the user's point of view (who I would guess in 99%
of cases use the Home screen which came with their phone), it is part
of the framework, they would naturally think it is due to that phones
implementation of Android, rather than understanding it is the Home
screen app itself.

Anyway, it is what it is, so back to work...

Regards
James

On Jan 14, 7:51 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Sat, Jan 14, 2012 at 5:21 AM, Dusk Jockeys Android Apps

 duskjock...@gmail.com wrote:
  from my point of view the animation is part
  of the functionality, as it is the raison d'etre of the app...

 As Ms. Hackborn pointed out, there is no law requiring home screens to
 support animations. *Any* home screen, whether written by a device
 manufacturer or an independent developer, might elect to suppress your
 animations (e.g., a PowerSaver brand home screen that specifically
 disables certain things, like app widget animations, to save battery
 life).

 Hence, from your USP standpoint, you need to de-emphasize animations,
 or point out that they work only with compliant home screens.

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

 Android Training in NYC:http://marakana.com/training/android/

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