Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread Serdel
W dniu czwartek, 27 września 2012 12:52:25 UTC+2 użytkownik skink napisał: > > > > Serdel wrote: > > skink: your code works but the matrix seems calculate the points before > > resizing the image. > > > > i don't think so since this matrix is used interna

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread Serdel
, Kostya Vasilyev wrote: > > Yes, there are methods for measuring and positioning views. They are > called onMeasure and onLayout, respectively... > > 2012/9/27 Serdel > > >> I passed my progress bar object to my ImageView subclass but if I set the >> layout params on

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread Serdel
correct resized parameters I can't use them to position my progress bar. Is there a method in the main UI thread or inside my ImageView subclass that I can use for that purpose? On Thursday, September 27, 2012 11:26:49 AM UTC+2, Serdel wrote: > > > "onMeasure may be called

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread Serdel
and progress views as its > children. > > onMeasure may be called multiple times, yes. > > -- K > > 2012/9/27 Serdel > > >> Hi Kostya, >> >> I am not sure what is complicated here... I just want to place my >> progress bar in the exact location o

Re: [android-developers] Aligning a view to an ImageView in different resolutions

2012-09-27 Thread Serdel
p the drawing and add an > image view as a child... you'd need to position it too...) > > -- K > > 2012/9/26 Serdel > > >> The problem with properly handling multiple screen sizes on Android has >> been talked all over thousands of times. However I couldn'

[android-developers] Aligning a view to an ImageView in different resolutions

2012-09-26 Thread Serdel
The problem with properly handling multiple screen sizes on Android has been talked all over thousands of times. However I couldn't find a solution to m problem. In a nutshell I need to align my custom progress bar over an imageView. I've got 3 set of drawables for the imageView - ldpi(scaled fo

[android-developers] Re: implementing fade-in/fade-out effects in Java with frame-based animation

2012-03-20 Thread Serdel
e frames is the > rotation then you can use the approach I described. > > Thanks, > Justin Anderson > MagouyaWare Developerhttp://sites.google.com/site/magouyaware > > On Tue, Mar 20, 2012 at 11:23 AM, Serdel wrote: > > > Thanks for the response but the animation is a

[android-developers] Re: implementing fade-in/fade-out effects in Java with frame-based animation

2012-03-20 Thread Serdel
ot;         android:pivotY="50%" > android:duration="500"        android:startOffset="0"    /> >      android:fromYScale=".85"         android:toYScale="1" > android:duration="100"         android:startOffset="400" > android:pivotX=&quo

[android-developers] implementing fade-in/fade-out effects in Java with frame-based animation

2012-03-20 Thread Serdel
Hi, I am running an animation of a spinning star and I would like to add some fade-in/fade-out effects. I am loading the animation in Java by making the AnimationDrawable objects, and adding the bitmaps as frames and then setting it to an ImageView using setBackgroundDrawable. I there a way I can

[android-developers] Disapearing imageview (combined animation-list with state list)

2011-07-05 Thread Serdel
I tried to combine animation-list with state list in my application. I found an answer here: http://stackoverflow.com/questions/5299219/button-states-with-background-as-animationdrawable-in-android My button has an animation and a 'pressed' state. The onClick listener simply exits the activity (n

[android-developers] Re: Screen sizes and precise element placement.

2011-06-30 Thread Serdel
Kostya - thank you for the suggestion but this seems too complex for such a simple (or not?!) task.. I have many other elements in my application activities so writing such classes for every activity and placing each element manually really seems too complex.. there must be a simper way to accompli

[android-developers] Re: Screen sizes and precise element placement.

2011-06-30 Thread Serdel
I think Kostya is right - the dp and dip is the same thing... so this doesn't solve my problem, because I need to change (scale) the dp I use in my app... On 30 Cze, 12:31, Kostya Vasilyev wrote: > "dip" and "dp" are exactly the same thing. > > http://developer.android.com/guide/topics/resources

[android-developers] Re: Screen sizes and precise element placement.

2011-06-30 Thread Serdel
I am sorry but I don't get this one. Dpi is screen density as far as I understood... DPI- dots per inch... so the number of pixels on a inch area on the screen. So isn't it screen density? On 30 Cze, 12:16, Marcin Orlowski wrote: > On 30 June 2011 11:58, Serdel wrote: > > &g

[android-developers] Screen sizes and precise element placement.

2011-06-30 Thread Serdel
I have a problem with supporting different screen sizes. My application has different drawables for mdpi (320x480), hdpi (480x800) or ldpi (240x432). I also have different layout for small, normal- notlong, normal-long. Every size scaling or placement features are done in dp. However my problem is

[android-developers] Re: Progress circle (NOT indeterminate!)

2011-05-17 Thread Serdel
parameters, and then change it's name to package.classname of your own progress bar class. Hope it helps somebody. On 15 Maj, 20:39, Serdel wrote: > Thanks guys, I have tested all this and almost achieved what I want. I > have change the code form Romain Guy a little bit so

[android-developers] Re: Progress circle (NOT indeterminate!)

2011-05-15 Thread Serdel
lding' has the same colour all the time. If this is manageable then I guess I'm home :> On 14 Maj, 20:42, Dianne Hackborn wrote: > Just set this as the drawable in a ProgressBar widget and control it with > that. > > On Sat, May 14, 2011 at 5:43 AM, Serdel wrote: > >

[android-developers] Re: Progress circle (NOT indeterminate!)

2011-05-14 Thread Serdel
That in deed is a nice approach. I wasn't aware that android has such a drawable. To abd this is more a 'ring' shape than a filled circle, but I guess a ring is also acceptable. But can you give me a hint how to control the 'progress' in the java code? So that I can i.e. increase it fluently in a t

[android-developers] Re: Progress circle (NOT indeterminate!)

2011-05-13 Thread Serdel
I want a progress circle 'bar' , because this is how it must be displayed in the graphic layout. I think I can do this with implementing the onDraw method and drawing the circle. Another problem which I see here is that the circle is quite strictly fit to the graphics around it (fitting correctly o

[android-developers] Re: Progress circle (NOT indeterminate!)

2011-05-13 Thread Serdel
Hmm actually I didn't though about using canvas and arcs - seems like a good idea. I was thinking about using image animations but was worried about the performance - for a fluent flow I would need 4 steps per second and I assume 15s so the animation would need 60 images. And I remember I had memor

[android-developers] Progress circle (NOT indeterminate!)

2011-05-13 Thread Serdel
As mentioned in the topic i do NOT want an indeterminate wheel. Instead I would like to animate a circle progress bard that actually shows how much time is left for a process (e.g. download) to finish. I saw something similar in soundhoud application. I am wondering how to make this - using an png.

[android-developers] Re: Activity Life cycle question

2011-04-05 Thread Serdel
com/guide/practices/ui_guidelines/activity_t... > > There are more solutions for your problem. > For example when the user presses the "Back A button" start your A > activity with Intent > and use the FLAG_ACTIVITY_CLEAR_TOP flag. > > On 5 April 2011 14:55, Serdel wrote: >

[android-developers] Activity Life cycle question

2011-04-05 Thread Serdel
Maybe the title of this topic is not quite proper but it considers the life cycle of android activities. I looked through many open source project and saw that usually when an activity is opened form a basic one the main screen is not closed. When the user presses the 'back' button the new activity

[android-developers] Re: Orientation change problem.

2011-03-02 Thread Serdel
As usual thanks Kostya :> The manifest tags work and I don't see the slow down effect now. Actually my application did not crashed by throwing an error but rather, just closed. It happened on only 1 activity, and the only one when I defined the onPause, onStop, onDestroy methods because I stop some

[android-developers] Re: Orientation change problem.

2011-03-01 Thread Serdel
Well If I start the activity in portrait the log is: 03-01 23:20:13.426: INFO/ActivityManager(113): Starting activity: Intent { cmp=com.blazel.apis/.SecondScreen (has extras) } 03-01 23:20:13.676: DEBUG/SurfaceFlinger(113): createSurface for pid 1694 (1 x 1), clientID=0x8 03-01 23:20:13.686: ERROR

[android-developers] Re: Orientation change problem.

2011-03-01 Thread Serdel
I don't want to get into much details but just the form of my application can't be presented in a landscape form - it will only look good in portrait so I want to keep it this way. I now had added android:configChanges="orientation|keyboardHidden" To all of my activities (when I added 'globally'

[android-developers] Orientation change problem.

2011-03-01 Thread Serdel
I have a problem with changing orientation or to be more clear - keeping the portrait orientation. As a first Thing in my onCreate() method I set: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

[android-developers] Re: Efficient fifo queue for primitive types?

2011-02-24 Thread Serdel
Thanks Kostya, I was hoping to find something similar in the android api. The circular buffer is a solution although I think the fifo queue would be faster...or not? Need to reconsider that. I would definitely need to expand the size of the queue to avoid additional memory allocation, and avoid the

[android-developers] Efficient fifo queue for primitive types?

2011-02-24 Thread Serdel
I am trying to find an efficient fifo queue for primitive types. I need this for processing recorded samples with AudioRecord class. My problem is that I need to process the samples in excactly 5000 chunks. But the buffer size gained by getMinBufferSize is different on each devices and more over th

[android-developers] Re: Can't properly stop a thread

2011-02-02 Thread Serdel
gt; current network operation in the worker to fail with an IO exception. > > -- Kostya > > 02.02.2011 15:35, Serdel пишет: > > > Thank you Kostya. As you have nicely noticed my network code doesn't > > 'see' any flag so that's not an option f

[android-developers] Re: Can't properly stop a thread

2011-02-02 Thread Serdel
Thank you Kostya. As you have nicely noticed my network code doesn't 'see' any flag so that's not an option for me. Setting the handler to null actually came to my mind but it seem a little bit 'dirty'. What worries me is that if I exit my application, the thread is still working, trying to conne

[android-developers] Can't properly stop a thread

2011-02-02 Thread Serdel
In my application I am connecting to a server and downloading some things. Not much but the connection it self takes a while. Off course this is done in a thread (class that implements runnable). If some error occurs, the thread sends a message to the UI using a Handler and the UI displays an dialo

[android-developers] Re: Order of insert

2011-01-11 Thread Serdel
Thanks for your answers. I was suggested a easier solution by sorting the list by rowid so i do not need to add another column. On 11 Sty, 13:37, Marcin Orlowski wrote: > On 11 January 2011 13:10, Serdel wrote: > > > I am wondering how can I insert an element at the beginning of

[android-developers] Order of insert

2011-01-11 Thread Serdel
I am wondering how can I insert an element at the beginning of the data base? I want to do this because: a) I want to display the elements (ListView) as 'last-inserted on top and first-inserted on the bottom' (like a stack) b) I want to limit the amount of elements in my db. When a new element is a

[android-developers] Re: Problem with refreshing listview from a dialog window

2011-01-05 Thread Serdel
ld try subclassing CursorAdapter, get > mChangeObserver (it's protected) and call onChange() to simulate a > notifcation normally delivered from ContentProvider. > > -- Kostya > > 14.12.2010 13:10, Serdel пишет: > > > > > Hello, > > > I have a listview and

[android-developers] Re: Fast way to write and read buffered data from AudioRecord

2011-01-05 Thread Serdel
ote: > On Jan 5, 12:57 am, Serdel wrote: > > > I have accomplished sth. by using the ByteArrayOutputStream - I divide > > the recorder short sample into 2 bytes. Thats again - not as efficient > > as It could be but significantly faster than ArrayList > > &g

[android-developers] Re: Vertical attributes don't work in RelativeLayout

2011-01-05 Thread Serdel
as it would be with > height=wrap_content. > > Using fill_parent for list item height is meaningless anyway, that would > mean that you want your list item to be as tall as the list view - so > only one list item per list. > > Use wrap_content, and make sure there is something

[android-developers] Re: Vertical attributes don't work in RelativeLayout

2011-01-05 Thread Serdel
I'm putting fill_parent in the height of relative layout. On 5 Sty, 10:18, Kostya Vasilyev wrote: > Does your RelativeLayout have sufficient height for align-bottom or > align-vcenter to actually do something? > > -- Kostya > > 05.01.2011 12:06, Serdel пишет: > &g

[android-developers] Vertical attributes don't work in RelativeLayout

2011-01-05 Thread Serdel
Hi, I am using RelativeLayout to arrange the look in my ListView items. I had passed the ViewGroup parent to the inflater as advised: public View newView(Context context, Cursor c, ViewGroup parent) { View v = mInflater.inflate(R.layout.myidsrow, parent, false); //. } The pr

[android-developers] Re: Fast way to write and read buffered data from AudioRecord

2011-01-05 Thread Serdel
Sty, 19:35, Keith Wiley wrote: > On Jan 4, 12:41 am, Serdel wrote: > > > How do you predict the size of the destination array? I mean I think > > you also copy the samples from audiostream into a smaller temp buffer > > and then into your dest. larger one - if you use an arra

[android-developers] Re: Fast way to write and read buffered data from AudioRecord

2011-01-04 Thread Serdel
I tried to switch to ENCODING_PCM_8BIT but am getting the exception: java.lang.IllegalArgumentException: Invalid audio buffer size Although I pass the correct value to getMinBufferSize. Do I need to change sth else? On 4 Sty, 09:41, Serdel wrote: > How do you predict the size of

[android-developers] Re: Fast way to write and read buffered data from AudioRecord

2011-01-04 Thread Serdel
How do you predict the size of the destination array? I mean I think you also copy the samples from audiostream into a smaller temp buffer and then into your dest. larger one - if you use an array for the dest. one how do you set size of that? On 4 Sty, 08:49, Keith Wiley wrote: > In my audio app

[android-developers] Re: Fast way to write and read buffered data from AudioRecord

2011-01-04 Thread Serdel
How do you predict the size of the destination array? I mean I think you also copy the samples from audiostream into a smaller temp buffer and then into your dest. larger one - if you use an array for the dest. one how do you set size of that? On 4 Sty, 08:49, Keith Wiley wrote: > In my audio app

[android-developers] Re: Fast way to write and read buffered data from AudioRecord

2011-01-04 Thread Serdel
How do you predict the size of the destination array? I mean I think you also copy the samples from audiostream into a smaller temp buffer and then into your dest. larger one - if you use an array for the dest. one how do you set size of that? On 4 Sty, 08:49, Keith Wiley wrote: > In my audio app

[android-developers] Fast way to write and read buffered data from AudioRecord

2011-01-03 Thread Serdel
I have a working implementation of the AudioRecrod class. I however I need the samples only in a buffered form so I don't want to save them on the phone hard memory, but keep them in a buffered way. Write now I am saving the files using an ArrayList of type like that: for (int idxBuffer = 0; idxB

[android-developers] Re: Problem with AnimationDrawable

2011-01-03 Thread Serdel
Take a look here where I explained that while asking another question: https://groups.google.com/group/android-developers/browse_thread/thread/9c10ceff77cd7ed3/9d381a5f3d36f0c4?hl=pl&lnk=gst&q=Strange+Problem+with+releasing+bitmaps+and+%27back%27+button+#9d381a5f3d36f0c4 -- You received this mes

[android-developers] Problem with refreshing listview from a dialog window

2010-12-14 Thread Serdel
Hello, I have a listview and my implementation of the CursorAdapter. As a part of my list item I have a delete button. When the user presses the button I show a dialog asking for confirmation and if the user presses ok I delete the item from the database. The problem is with refreshing the listvie

[android-developers] Edditing cache xml file

2010-12-10 Thread Serdel
Hello, I am trying to write sth that is similar to a 'contact book' functionality. And I am wondering how to store the information data on the phone's hdd. The first thing that came to my mind is creating an xml file for this: I can add following elements like that: John Smith Something I can

[android-developers] Strange Problem with releasing bitmaps and 'back' button

2010-12-05 Thread Serdel
Hi, This would be hard to explain so I'll try to make it as simple as it can be. I have an app that consist 2 activities. In the first one I have 2 animations with bitmaps.When I used the google suggested approach for animationdrawable (with xml file) I was constantly having OOME. Only using Bitm

[android-developers] Re: Button placement problems

2010-12-05 Thread Serdel
Thanks for your contribution Kostya - this really helped with greater understanding of Android layout designing, which is quite annoying to be honest :> -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to an

[android-developers] Re: Button placement problems

2010-12-04 Thread Serdel
But the problem is to place them on the same area on the screen. I only could come up with margins but I try to avoid that. Right now I have solved this by grouping the buttons in a linear layout and set the background of this layout. Then the layout is placed inside a parent relative layout and al

[android-developers] Re: Button placement problems

2010-12-03 Thread Serdel
As long as you have been so helpful - do you know any way to put an imageview (or any other object) deliberately "behind" other objects? For example if I would like to put an image behind my buttons to make a background for the small gap between them (and I want this gap to be filled - don't want t

[android-developers] Re: Button placement problems

2010-12-03 Thread Serdel
Thank you Kostya and sorry for my mistake :> The ImageView approach works. Though the eclipse layout 'designer' doesn't show this (the images are cropped) it works on the device. Again thanks for the solution. -- You received this message because you are subscribed to the Google Groups "Android

[android-developers] Re: Button placement problems

2010-12-03 Thread Serdel
Thank you Kostya and sorry for my mistake :> The ImageView approach works. Though the eclipse layout 'designer' doesn't show this (the images are cropped) it works on the device. Again thanks for the solution. -- You received this message because you are subscribed to the Google Groups "Android

[android-developers] Re: Button placement problems

2010-12-03 Thread Serdel
Thanks Vasilyev, The aspect ration is in deed a very important factor - I was surprised why my layout looks fine in eclipse plug in but corrupts on the device. Only when I design my own dev config with proper size and ratio as long it worked correct. I now have a quite similar problem. Because I h

[android-developers] Re: Button placement problems

2010-12-03 Thread Serdel
Thanks Vasilyev, The aspect ration is in deed a very important factor - I was surprised why my layout looks fine in eclipse plug in but corrupts on the device. Only when I design my own dev config with proper size and ratio as long it worked correct. I now have a quite similar problem. Because I h

[android-developers] Re: Button placement problems

2010-12-03 Thread Serdel
Thank you all for your response. I am now reading about supporting multiple screens in android : http://developer.android.com/guide/practices/screens_support.html My problem is that the buttons must be preciously placed to correspond properly with the background (that's why the accurate, exact dip

[android-developers] Re: Button placement problems

2010-12-01 Thread Serdel
Thanks for the response. Yeah the centered_vertical is not necessary. I put because I was wondering whether I can o a margin from the center of the screen. For the second question - yes I need the space. The B1 should be placed below the center of the screen, and B2 and B3 should be in the bottom r

[android-developers] Button placement problems

2010-11-30 Thread Serdel
Hello, I could find anything similar so I decided to open a new thread. However if there already is a similar answer please post the link. I need to place my buttons in a little unconventional way shown here (dkw I could post the message with an imageshack link so an ASCI 'picture'): ___

[android-developers] Re: Problem with AnimationDrawable

2010-11-25 Thread Serdel
Ok it still needs some more testing but it looks like I have solved the problem by creating the animation with manually adding Bitmaps as frames, and then calling recycle() on them. And I can now run the 2 animations with full frame and size. It is a less elegant approach and more 'hard-coded' but

[android-developers] Re: Problem with AnimationDrawable

2010-11-25 Thread Serdel
Ok it still needs some more testing but it looks like I have solved the problem by creating the animation with manually adding Bitmaps as frames, and then calling recycle() on them. And I can now run the 2 animations with full frame and size. It is a less elegant approach and more 'hard-coded' but

[android-developers] Re: Problem with AnimationDrawable

2010-11-24 Thread Serdel
I was able to launch the 2 animation by decreasing the frame number to 4 for each. It works as a single launch but the OutOfMemoryError exception still occurs. The problem is when I want to go back from the last activity to the first one (as I wrote it is a 'ring' app), or when I exit and open the

[android-developers] Re: Problem with AnimationDrawable

2010-11-23 Thread Serdel
Well the draw9patch tool from android sdk had produced files 10 times bigger than the jpg that I used originally. One animation consists of 7 files, each one is 28-40 kb. The 9.png files were starting from 300 kb :> Although it doesn't seem much, and I saw people loading several animation in one a

[android-developers] Re: Problem with AnimationDrawable

2010-11-23 Thread Serdel
Ok I have managed to launch the animation at activity startup by putting it in the onWindowFocusChanged method. However I am still struggling with the out of memory problems. I tried to use some suggestions people give on the net like analyseAnimation.setCallback(null) oranalyseImage.setBackgroundD

[android-developers] Re: Problem with AnimationDrawable

2010-11-23 Thread Serdel
Thank you for the reply. I really don't get this - following your advice I moved the animation creating code out of OnCreate. Firstly I overrided an 'OnStart()' method of the main activity - nothing. Then I have put it in the OnTick() method of the timer in a simple if condition to launch only at t

[android-developers] Problem with AnimationDrawable

2010-11-23 Thread Serdel
Hello, I have problems with AnimationDrawable which i use to animate a 'striped' gif file. In fact I have two animations that I want to use in one activity (and they must be used in the same activity). Both animation are build with 7 frames : http://schemas.android.com/apk/res/ android" android

[android-developers] Raw and wav format

2010-11-17 Thread Serdel
Hello, I am using the AudioRecorder class on android. As far as I understand this gives me the audio data in .raw file format yes? Does anyone tried to convert this to a wav file? It should be done on Android, but in worst case I can do this on the server side which would have more access to Java

[android-developers] Problems with uploading files to webservice

2010-11-16 Thread Serdel
Hello, I have a rest webservice that takes a POST metod with multipart message: @Path("transferFile") @POST @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_XML) public String multipartTest(com.sun.jersey.multipart.MultiPart data) { try { // get first body part (index 0)

[android-developers] HttpPost and byte[] on Android?

2010-07-14 Thread Serdel
Hello, I am dealing with http post method on Android. I have successfully send simple string pairs using HttpClient and HttpPost class with the NameValuePair as entity. However now I want to send a simple array of bytes[]. Unfortunately the only entities I have found for the HttpPost class are the

[android-developers] Re: Change the progress bar style dynamically

2010-07-08 Thread Serdel
Well instead of two xml files I have two ProgressBar objects located in the same place on the screen, so instead of reloading the layout I just manipulate their visibility (which I alredy mentioned in the first post :>). Any way thanks for the contribution. -- You received this message because yo

[android-developers] Re: Change the progress bar style dynamically

2010-07-07 Thread Serdel
Yes I have but this class does not have any method to change the style of a progressBar, like the ProgressDialog class. The style of a progressBar is defined in the xml file by special attributes but there are no methods related to them... -- You received this message because you are subscribed t

[android-developers] Re: Change the progress bar style dynamically

2010-07-07 Thread Serdel
But this is a Dialog object which I don't want to create. I was referring to ProgressBar - a View 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 unsubsc

[android-developers] Re: Change the progress bar style dynamically

2010-07-03 Thread Serdel
Ekhem... thank for your answer but the problem is that I don't know HOW to do this. So if it is possible I humbly ask for an advice how to do this, because I haven't seen any methods that regard to style in the progress bar class... -- You received this message because you are subscribed to the G

[android-developers] Change the progress bar style dynamically

2010-07-01 Thread Serdel
Is it possible to change the style of the progress bar dynamically in the code?? For instance I do some work and progress is shown by the horizontal bar, and after the work is done I do some other work but want to present it by the Vertical bar. Can I change the style of a single bar in the code or

[android-developers] Re: Changing screens - switching between layouts?

2010-06-06 Thread Serdel
Thank you for the contribution TreKing. I learned about start new activities using the Intent objects. However I don't thing it is suitable for my idea. Intent are useful in apps that have one 'menu' screen which has many buttons leading to other screens. In my app I don't want any menu screen - e

[android-developers] Changing screens - switching between layouts?

2010-06-01 Thread Serdel
Hello, I am trying to create an app for android 1.5 which would be organized around 4-5 'screen's that will be changing in a given order. So I start ma app with the first screen, which it's background and a button. When I click on the button a new screen appears with a different background and di