[android-developers] Re: Android application StartUp Internals

2012-04-29 Thread Mansoor


Thanks Nadeem I Understood.

When i checked setContentView() API i found that a new instance of
Window is getting created so if there is already a default window then
why new instance of window getting created on call this method?

Regards
Mansoor V.M

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


[android-developers] Android application StartUp Internals

2012-04-27 Thread Mansoor
Hi all,
I am very much interested to know how an android application
starts.After much googling I understood something but not fully.

Below some of my observations:

1.When i click an application icon from launcher ,System look for
activity with intent action main and category Launcher and starts
that activity.
   *I need some more clarity regarding who launch main activity or
who
filtering main activity from others(I think package manager does).

2.Once Activity is launched there will be no windows associated with
that application until i call setContentView(layout id).

3.When i call setContentView(layout id),Activity creates a new Window
inance and this window has some default root layout to which we set
our layout .
 *I think this window have a Surface instance and is associated with
native Bitmap ?Did this surface have a Canvas wrapper over native
bitmap ?

4.Once Layout is attached to Window ,This window is added to Window
manager.

5.Window manager gives gives all window(having Surface) on screen to
Surface Flinger.

6.SurfaceFlinger based on visibility of window set pixels in
FrameBuffer and displays to screen.

I am not sure whether what i said above is right or wrong.Please
correct me if my understanding is wrong.
Also add extra processes happening whilhe application start up.

Thanks and have a Nice day :)

-- 
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 application StartUp Internals

2012-04-27 Thread Mansoor
Hi Mark Thanks for your reply :)

I have some doubts regarding the reply to point 2.
When i call setContentView(layoud id) only new window instance get
created before that there is no UI so no need of window right?

I am only a android application developer but i wish to know what
really happening behind the scene  :)

Where can i find exact information regarding this ?

Regards
Mansoor V.M

-- 
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 application StartUp Internals

2012-04-27 Thread Mansoor
Thanks a lot Mark

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


[android-developers] Android application StartUp Initialization

2012-04-26 Thread Mansoor
Hi all,

I am very much interested to know how an android application
starts.After much googling I understood something but not fully.
Below some of my observations:

1.When i click an application icon from launcher ,System look for
activity with intent action main and category Launcher and starts
that activity.
   *I need some more clarity regarding who launch main activity or who
filtering main activity from others(I think package manager does).
2.Once Activity is launched there will be no windows associated with
that application until i call setContentView(layout id).
3.When i call setContentView(layout id),Activity creates a new Window
inance and this window has some default root layout to which we set
our layout .
 *I think this window have a Surface instance and is associated with
native Bitmap ?Did this surface have a Canvas wrapper over native
bitmap ?
4.Once Layout is attached to Window ,This window is added to Window
manager.
5.Window manager gives gives all window(having Surface) on screen to
Surface Flinger.
6.SurfaceFlinger based on visibility of window set pixels in
FrameBuffer and displays to screen.

I am not sure whether what i said above is right or wrong.Please
correct me if my understanding is wrong.
Also add extra processes happening whilhe application start up.

Thanks and have a Nice day :)

-- 
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: ScrollView resize issue with LinearLayout

2012-03-16 Thread Mansoor


Please give some suggestion i am stuck

-- 
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] ScrollView resize issue with LinearLayout

2012-03-15 Thread Mansoor
Hi,
I have a scrollView with linear layout as child Layout .This child
linear layout has two other linear layout in vertical
orientation .Layout follows
ScrollView/*height=wrap content*/
   LinearLayout /*layout 1*/ /*height=wrap content*/
   LinearLayout /* inner layout 1 */ //*height=wrap content*/
   LinearLayout /* inner layout 2 */ //*height=wrap content*/
   /LinearLayout
/ScrollView
Inner layout 1 and 2 contains dynamic number of views. So i am
expecting the scrollview to resize based on child contents(number of
views) but the output is , when i remove inner layout 1  child views
the scrollview is not resizing  it remains same height as before
removing its child views. But behaviour is proper when i remove inner
layout 2 child views. Please help why this unexpected behaviour of
scrollview.

Thanks in Advance .

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


[android-developers] ExpandableListView How to get bitmap of each item separately

2012-01-31 Thread Mansoor
Hi,

I am trying expand/collapse animation in expandable listview but i am
stuck :(

i have two group each with some dynamic number of items.

so when first group expands, second group slides down (along with its
child items) smoothly and displays first group child items with some
alpha animation.

I got idea for this animation but i have to get bitmap for each (group
and child) and draw this bitmap on surfaceview canvas with some logic
but problem is how to get bitmap for group/child items .
I tried following and got first group bitmap :
View mView = mExpandableListView.getChildAt(0);
mView.setDrawingCacheEnabled(true);
mView.setDrawingCacheQuality(DRAWING_CACHE_QUALITY_HIGH);
Bitmap sweet = mView.getDrawingCache();

but how to get bitmap for particular group /child generically ?

Please help me with your valuable comments :)

Thanks and regards

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


[android-developers] Re: ExpandableListView How to get bitmap of each item separately

2012-01-31 Thread Mansoor
Hi Treking Thanks for your reply :)

I am facing one issue even for getting bitmap of first group item.

My  group item layout/UI changes in expand and collapse state .

If i get drawing cache in expand state i am getting bitmap correspond
to collapse state ...

How to get latest bitmap of corresponding group ?

Thanks and regards
Mansoor V.M



-- 
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] activityCloseExitAnimation not working

2011-09-14 Thread Mansoor
Hi,
I tried to apply enter/exit animation to my activity using following
style

resources
style name=VizioActivityAnimation parent=android:style/
Animation.Activity
item name=android:activityOpenEnterAnimation@anim/
launch_left_to_right/item
item name=android:activityCloseExitAnimation@anim/
close_right_to_left/item
/style
/resources

When i start my application the main activity is entering with
animation but when i press back button its exiting without animation.


please help !!

Thanks and regards
Mansoor

-- 
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] activityCloseExitAnimation not working

2011-09-14 Thread Mansoor
Hi,
I tried to apply enter/exit animation to my activity using following
style

resources
style name=myActivityAnimation parent=android:style/
Animation.Activity
item name=android:activityOpenEnterAnimation@anim/
launch_left_to_right/item
item name=android:activityCloseExitAnimation@anim/
close_right_to_left/item
/style
/resources

When i start my application the main activity is entering with
animation but when i press back button its exiting without animation.


please help !!

Thanks and regards
Mansoor

-- 
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: Expandable ListView : A special scenario

2011-08-02 Thread Mansoor


Hi Treking thank you very much for the best solution. It worked :)

-- 
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 acheive following scenario in Expandable ListView.

2011-08-01 Thread Mansoor
Hi ,
Consider a expandable listview with two parent item Parent1 and
Parent2 . Each item have some child item.
--
 Parent1

-- 
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] Expandable ListView : A special scenario

2011-08-01 Thread Mansoor
Hi ,
Consider a expandable listview with two parent item Parent_1 and
Parent_2 . Each item have some child item.
--
  Parent_1
--
  Parent_2
--

if Parent is in collapsed state i want to show a view(for example a
TextView) down that parent
--
  Parent_1
--
TextView
-
  Parent_2
--
TextView
--

if Parent is in  expanded state the textView should be in gone state
and corresponding child items is showned
---
  v Parent_1
---
child items.
--
  Parent_2
--
TextView
--

I got a alternate solution by creating two expandable listview with 1
parent item each. and a textview down to each expandable listview. so
when fexpandable listview expand/collapse i make corresponding
textview gone/visible. But problem is i want to scroll both expandable
listviews and textviews as a one unit .for that i used scrollview as
follow:

ScrollView
ExpandableListView/
TextView/
ExpandableListView/
TextView/
/ScrollView

But am not getting expected scroll behaviour. I know above approach is
not proper as listview should not be contained inside scrollview .

Is there any better solution for this problem . please share your
valuable suggestion and help me.

Thanks and regards
Mansoor V.M


-- 
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] Why seekbar progress background always rounded corner ?

2011-06-16 Thread Mansoor
Hi,
I am using a red rectangular image as seekbar progress background but
background is always drawing with rounded corner. how can i make it as
rectangular without rounded corner?

Following is my seekbar layer-list:

?xml version=1.0 encoding=utf-8?
 layer-list xmlns:android=http://schemas.android.com/apk/res/
android

 item android:id=@android:id/background
 android:drawable=@drawable/mybackground
  
  corners android:radius=0dp/
 /item

item android:id=@android:id/secondaryProgress
clip
shape
corners android:radius=0px /
gradient
android:startColor=#80ffd300
android:centerColor=#80ffb600
android:centerY=0.75
android:endColor=#a0ffcb00
android:angle=270
/
/shape
/clip
/item

item android:id=@android:id/progress
  
   scale android:scaleWidth=100%
   android:drawable=@drawable/progress /

/item


/layer-list

please help me ..

Thanks and regards
Mansoor V.M

-- 
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] FLAG_ACTIVITY_CLEAR_TOP VS singleTask launchMode

2011-06-09 Thread Mansoor
Hi all,

I am bit confused after reading documentation about
FLAG_ACTIVITY_CLEAR_TOP and  singleTask launchMode

In documentation it given as :
{
FLAG_ACTIVITY_CLEAR_TOP
If the activity being started is already running in the current
task, then instead of launching a new instance of that activity, all
of the other activities on top of it are destroyed and this intent is
delivered to the resumed instance of the activity (now on top),
through onNewIntent()).

There is no value for the launchMode attribute that produces this
behavior.

}

But i  experimented  FLAG_ACTIVITY_CLEAR_TOP behaviour using
singleTask launchMode and i got exactly same . I created 3 activies
Activity_A,Activity_B and Activity_C. In manifest file i set
android:launchMode=singleTask for activity B. Each activity have a
button to launch next activity ie Activity_A launches Activity_B
launches Activity_C launches Activity_B.

so this is the order in which i launch activity ABCB.

In case of FLAG_ACTIVITY_CLEAR_TOP:
I did ABC then as per documentation i started Activity_B from
Activity C using intent with flag FLAG_ACTIVITY_CLEAR_TOP so Activity
C is destroyed and back stack contains AB .

In case of singleTask launchMode in Activity_B:

i followed same procedure as ABCB above instead of
FLAG_ACTIVITY_CLEAR_TOP flag i used singletask launch mode . finally
the back stack contains AB .

So what is difference between both ?In documentation it says   There
is no value for the launchMode attribute that produces this behavior
as of FLAG_ACTIVITY_CLEAR_TOP but I got same behaviour with
singleTask launchMode ..

Please clear my understanding 


Thanks and regards
Mansoor V.M


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


[android-developers] Re: Adding animation to LinearLayout

2011-06-09 Thread Mansoor
hi,
In your onCreate  method  u doing something wrong

LinearLayout layout = (LinearLayout) findViewById(R.layout.menu);

u have to give linear layout id instead of using R.layout.menu

it should be somthing as follow:

LinearLayout layout = (LinearLayout) findViewById(R.id.your linear
layout id given in xml);

regards
Mansoor V.M

-- 
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] HoneyComb VolumePanel customization issue

2011-06-02 Thread Mansoor
hi,
i am trying to customize VolumePanel UI in honeycomb but i am not able
to make the volumepanel bottom of screen.
i changed following code snippet in VolumePanel.java to make the
dialog bottom of screen

// Change some window properties

Window window = mDialog.getWindow();
//window.setGravity(Gravity.TOP);
window.setGravity(Gravity.BOTTOM);
WindowManager.LayoutParams lp = window.getAttributes();
lp.token = null;
lp.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
window.setAttributes(lp);
window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);

i changed setGravity to bottom but still dialog(contains custom
layout) not coming to bottom.it is displaying somewhat middle only ?
am missing anything?
I also tried to show a toast from volume panel that also not showing
in bottom ?

Please help ...

Thanks and regards
Mansoor V.M

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


[android-developers] How to set width and height of a View in DP through code not in XML ?

2011-01-26 Thread Mansoor
hi ,
i am creating a Image view  through code dynamically based on certain
condition as below:

ImageView t = new ImageView(mContext);
t.setLayoutParams(new LinearLayout.LayoutParams(390,
300));
the width and height is in PX i.e 390 PX and 300 PX

but i want to know how to set width and height in dp instead of px
programmatically . In xml we can do but i have no idea how to do it in
code
please help me .

Thanks
Mansoor V.M

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


[android-developers] Re: How to Declare file write permission in framework code

2010-12-14 Thread Mansoor

hi Dianne Hackborn,

is there any better way to handle this issue instead of modifying
launcher ?

-- 
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 Declare file write permission in framework code

2010-12-13 Thread Mansoor
hi friend,

i created a custom listview in framework
path: /froyo/frameworks/base/core/java/android/widget/
and i am using this listview inside homescreen widget just like analog
clock.
Inside this custom listview as per my requirement, i am creating a
file output stream as
FileOutputStream out = new   FileOutputStream(sdcard/share.png);
But at this line  i am getting a FileNotFoundException (permission
denied )
even i set android.permission.WRITE_EXTERNAL_STORAGE in my widget
manifest.
Please help me how can i set the permission for my custom listview in
framework  ?

Thanks and regards
Mansoor V.M

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


[android-developers] Re: How to Declare file write permission in framework code

2010-12-13 Thread Mansoor
hey thanks a lot  Kostya Vasilyev and Chris Stratton for your  kind
reply :)
i resolved the issue by adding uses-permission
android:name=android.permission.WRITE_EXTERNAL_STORAGE/uses-
permission tag to Launcher application manifest .
Thanks a lot once again :)

-- 
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] Gestures in custom view?

2010-10-07 Thread Mansoor
hi friends,
I am trying to handle fling event in my custom view using gesture
detector but  onFling() method is not calling .code snippet for
handling fling follows

public class CustomView extends View {

private GestureDetector gestureDetector;

public CustomView6(Context context, AttributeSet ats, int
defaultStyle) {

super(context, ats, defaultStyle);
 gestureDetector = new GestureDetector(new MyGestureDetector());

}

@Override
public boolean onTouchEvent(MotionEvent e) {

 Log.e(,ontouch);

 if (gestureDetector.onTouchEvent(e)) {
 return true;
 }
 return false;
}

class MyGestureDetector extends SimpleOnGestureListener {
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float
velocityX, float velocityY) {
Log.e(,onFling);
return true;
}
}

}


Am missing something? please help me...

Thanks and regards

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


[android-developers] Re: Water ripple effect

2010-07-09 Thread Mansoor
Thanks robert green . and all who replied to the post.
I acheived the ripple effect by drawing the water background on a 2d
mesh and generated ripples by using sine wave function.Ripples are
quite realistic and good.once again thank u all :)

-- 
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: Water ripple effect

2010-07-07 Thread Mansoor
hi treking,
i am expecting some technical advice to acheive ripple effect ...if
anyone know it please share..
Thanks and regards

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


[android-developers] Water ripple effect

2010-07-05 Thread Mansoor
hi friends,
i am trying to create a ripple effect one similar to water live
wallpaper in nexus one.please give me direction to acheive it.
Thanks and regards :)
Mansoor

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