[android-developers] Re: Resetting the activity stack

2009-09-22 Thread Andrei Bucur
http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_CLEAR_TOP

On Tue, Sep 22, 2009 at 11:26 AM, tauntz tau...@gmail.com wrote:


 Hi

 Activities:
 A  B  are activities that once you have navigated away from them,
 it's not logical that you can get back to them using the back button.
 C ... X are activities that follow the usual can go back to where you
 came from flow.

 App flow:
 * Launch app from Home - starts A
 * From A start B
 * Finish A (removes it from stack)
 * From B start C
 * Finish B (removes it from stack)
 * From C start D
 * From D start E

 Once the user has reached E, the activity stack looks like this: C - D -
 E.

 Can I somehow reset the whole stack so it starts again at A so it's as
 the user just launched it from Home (so that C... E are removed from
 the history stack)?

 From
 http://developer.android.com/guide/topics/fundamentals.html#clearstack:
 In my case alwaysRetainTaskState = true, clearTaskOnLaunch = false,
 finishOnTaskLaunch = false, because it's logical that the user
 continues in the same activity where he left - even after long periods
 of time. Even if alwaysRetainTaskState was false, it would still not
 address my problem of manually clearing the stack at a random point
 in time from within the application.
 There's another way to force activities to be removed from the stack.
 If an Intent object includes the FLAG_ACTIVITY_CLEAR_TOP flag, and the
 target task already has an instance of the type of activity that
 should handle the intent in its stack, all activities above that
 instance are cleared away so that it stands at the top of the stack
 and can respond to the intent. - that also doesn't work for me since
 A isn't in the stack so launching it with that flag won't clear
 anything from the stack :(


 Tauno

 


--~--~-~--~~~---~--~~
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 force soft keyboard to be visible?

2009-09-18 Thread Andrei Bucur
super.onCreate(savedInstanceState);

InputMethodManager imm =
(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,
InputMethodManager.HIDE_IMPLICIT_ONLY);

On Thu, Sep 17, 2009 at 11:17 PM, Mike Collins mike.d.coll...@gmail.comwrote:


 I have a dialog that requires the use to type something.  I'd like to
 force the soft keyboard to be visible when this window starts.

 I've tried most everything that looks applicable and nothing works.

 The API demos of SDK 1.5 have a set of windows that have this
 android:windowSoftInputMode=stateVisible|adjustPan set in the
 manifest and they don't get the soft keyboard either.

 Using either the 1.5 emulator or the 1.6 emulator or a 1.5 phone.

 tia,
  mike

 


--~--~-~--~~~---~--~~
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 secure is SharedPreferences?

2009-09-15 Thread Andrei Bucur
So basically storing private data on the phone is actually impossible? I
must implement a system that needs to store some information at some times
in application lifetime. This information must not be deleted / modified in
any way because of security issues (the user could trick the system).
Is there a way to this on a rooted phone (I'm pretty sure it's not... but
the question worths a shot)?

Thanks!

On Tue, Sep 15, 2009 at 2:39 AM, Romain Guy romain...@google.com wrote:


 The content of shared preferences is, currently, stored in an XML file
 in the data partition. Only your app has the permission to look into
 the directory that contains the XML file but if your user has a rooted
 phone then all bets are off.

 On Mon, Sep 14, 2009 at 4:10 PM, bkbonner brian.bon...@paraware.com
 wrote:
 
  We want to store credentials for a user to a web service so the user
  doesn't have to repeatedly login, but we're concerned about security.
  We can't store a hash on the database, but we could probably use JCE
  encryption locally.
 
  Is the content in SharedPreferences secured on the Android device?
 
  Brian
  
 



 --
 Romain Guy
 Android framework engineer
 romain...@android.com

 Note: please don't send private questions to me, as I don't have time
 to provide private support.  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
-~--~~~~--~~--~--~---



[android-developers] Re: Soft keyboard in Fullscreen/extract mode

2009-09-11 Thread Andrei Bucur
There's a post on this groups regarding the resize issue. It seems that
using the FULL_SCREEN flag actually (as it's name suggests) makes the IME
unable to steal a part of the screen for display purposes.
And regarding the other problem... try using InputType.TYPE_NULL +
InputMethodManger.showSoftInput(..., SHOW_FORCED). From my experiments in a
custom edit box I noticed that in landscape the IME is no longer fullscreen
(I think it was also documented in the InputMethodService reference page).

--~--~-~--~~~---~--~~
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: buttons hidden

2009-09-07 Thread Andrei Bucur
I would recommend using the RelativeLayout instead of the linear layout. You
could place them like this:
- first label aligned top parent (Band)
- second label below first label (Members)
- second edit text (Members list) right of second label, aligned top with
second label and aligned parent right
- first edit text (Band name) right of first label, aligned top with first
label, aligned left with second edit text and aligned parent right
- Ok button below second label, aligned parent left
- Cancel button below second lable, right of Ok button

I placed the Band edit box relative to the Members edit box because it's
label will always have more pixels so if we want to obtain a nice effect
where the edit boxes have the same sizes and fill the usable space. As you
can see there are no hard coded dimensions or anything.

On Mon, Sep 7, 2009 at 2:12 AM, Mark Murphy mmur...@commonsware.com wrote:


 Carl wrote:
  Thanks, I'm such an idiot! The docs say LinearLayout aligns all
  children in a single direction, I expected the items to wrap around
  and continue underneath.

 Ah!

 Android lacks that sort of FlowLayout like you see in Swing. That'd be a
 nice project for somebody...

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

 Android Development Wiki: http://wiki.andmob.org

 


--~--~-~--~~~---~--~~
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: Stop Soft Keyboard from appearing

2009-09-07 Thread Andrei Bucur
I guess Window.setSoftInputMode() with
http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#SOFT_INPUT_STATE_ALWAYS_HIDDENshould
do the trick. Haven't tested it though.

On Mon, Sep 7, 2009 at 2:19 PM, kalyan simhan kalyansim...@gmail.comwrote:

 Hi all..
 Is there any way to prevent the soft keyboard from appearing through out my
 application??
 I have implemented my custom keyboard and do not want the soft keyboard
 from appearing
 on focus of the EditText.  is there any way or is setting the input type
 for each EditText as
 TYPE_NULL the only way.Kindly help!
 Thanks in advance!

 


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



[android-developers] Re: Activity stack: A B C - press BACK - go to A

2009-08-31 Thread Andrei Bucur
Maybe this helps:
http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_PREVIOUS_IS_TOP

On Mon, Aug 31, 2009 at 4:28 AM, tstanly tsai.sta...@gmail.com wrote:


 can possiable to verify whether B is exist or not?
 if B exist,so the apps can call finish() to close B,
 if not,don't call B.finish()
 (will be error because B is not exist)


 thanks!

 On 8月31日, 上午4時11分, Jonas Petersson jonas.peters...@xms.se wrote:
  fhucho wrote:
   my activity stack is ABC, in activity C I press back, and return to B,
   then press back again and go to A. What should I do to return to A
   directly from C?
 
  I guess it depends on the reason for wanting to skip B. I needed
  exactly this case yesterday and in my case B knows very well that it
  will not be needed when it starts up C, so B simply calls finish()
  after that. Solved.
 
  Best / Jonas
 


--~--~-~--~~~---~--~~
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: Advice for speeding up my drawing

2009-08-27 Thread Andrei Bucur
Memory allocation can be very perverse especially if you don't know what
happens behind the curtain. From what I noticed a simple String allocation
implies most of the time an internal char array allocation (pretty obvious)
and many more that I can't now recall.

The rule is simple: If you can avoid it, do it. Any new in the drawing
method is BAD.

On Thu, Aug 27, 2009 at 3:37 PM, CG christian.glee...@gmail.com wrote:


 I have now changed most of the strings to startup initialized char
 arrays (missing 4)
 and I am completely baffled by the perfomance gain.

 I went from a comlpete render loop time on ~350-500 to 170-350
 


--~--~-~--~~~---~--~~
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: Advice for speeding up my drawing

2009-08-26 Thread Andrei Bucur
If you haven't tried already:
1. Replace the strings that get modified with char[]. Strings are immutable
objects so changing one means memory allocation and leaking.
2. Also check the Allocation Tracker for memory leaking.
3. For the constant strings I would use Picture or some bitmap buffer
mechanism to store the drawn text and then just place it on the Canvas
without overhead.

On Wed, Aug 26, 2009 at 12:24 PM, CG christian.glee...@gmail.com wrote:


 Hi, I am creating an app that show some histograms off your traveling
 speed in different time periods (histogram for the last minutte,
 histogram for the last 2 minuttes etc.)

 I would like to have an animation, and have discovered that drawing
 everything takes arround 300-400ms. wich is to long for making my
 animation smooth, the animation itself is quite simple (2 lines and 2
 dots).

 What i draw every frame right now is
 20 antialised strings, size 14,  in average ~5chars
 8 of these strings will change every second.
 1 of the string will change with the animation (this will become 5
 strings if there is time)

 the main part of the screen, the one showing the histogram data,
 consist of a lots of squares wich needs to be updated every second.
 (450 squares)

 the presentation is split into 5 frames in the same view (has to be
 same view as arrows in one frame might point into another frame)

 invalidating only a part off the screen makes almost no difference (it
 does becomas a bit faster, but i still execute all my drawing stuff).
 I have tried to add a flag wheter or not the main part is dirty, but
 if i don't draw it, it is cleared. I might be missing something
 here...

 One possibility could be to render all the mostly static stuff to a
 bitmap, and then simply draw the bitmap.
 that would mean 10 strings only had to rendered on orientation change.

 I think it would make sence since the slowest rutine is the one
 drawing all the text. (the following is a typical timing for the
 drawing rutines, accmulated).

 V/HMMULTIBAR(  352): 0 - Drawing time: 0 ms
 V/HMMULTIBAR(  352): 1 - Drawing time: 53 ms
 V/HMMULTIBAR(  352): 2 - Drawing time: 62 ms
 V/HMMULTIBAR(  352): 3 - Drawing time: 85 ms
 V/HMMULTIBAR(  352): 4 - Drawing time: 280 ms
 V/HMMULTIBAR(  352): 5 - Drawing time: 303 ms

 I would really appreciate comments about wheter or not offscreen
 rendering is the way to go, or if there is a simpler way.
 


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



[android-developers] Re: Is it possible for a View having more than one Canvas

2009-08-26 Thread Andrei Bucur
Use save/restore with MATRIX_SAVE_FLAG flag. Before rotating the canvas you
save the current matrix and after the first bitmap is drawn you restore it.

On Wed, Aug 26, 2009 at 2:09 PM, Nithin nithin.war...@gmail.com wrote:


 Hi,

 I have a View and that has a canvas. I am rotating the canvas, for
 rotating a bitmap. But after that, I need to draw one more bitmap on
 the Canvas and, this should not rotate. The second bitmap has to be
 static.

 I tried with matrix rotation for bitmap. But its not rotating in the
 specified co-ordinates.

 Open for all suggestions

 Thanks
 Nithin
 


--~--~-~--~~~---~--~~
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: setSoftInputMode() and addFlags()

2009-08-18 Thread Andrei Bucur
Sure! I built a simple example that looks something like my app layout:
?xml version=1.0 encoding=utf-8?

RelativeLayout android:id=@+id/RelativeLayout01
android:layout_width=fill_parent android:layout_height=fill_parent
xmlns:android=http://schemas.android.com/apk/res/android;
RelativeLayout android:id=@+id/RelativeLayout02
android:layout_height=wrap_content android:layout_width=fill_parent
android:layout_alignParentTop=trueTextView android:text=TextView01
android:id=@+id/TextView01 android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_centerHorizontal=true/TextView
/RelativeLayout
RelativeLayout android:layout_below=@+id/RelativeLayout02
android:id=@+id/RelativeLayout03 android:layout_width=fill_parent
android:layout_height=fill_parentEditText android:text=EditText01
android:id=@+id/EditText01 android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_centerInParent=true/EditText
/RelativeLayout
/RelativeLayout

and the onCreate() method:
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  //this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

  this.setContentView(R.layout.main);

  EditText editor = (EditText)findViewById(R.id.EditText01);
  editor.setImeOptions(EditorInfo.IME_ACTION_DONE);
  }

Don't use ADJUST_PAN, but ADJUST_RESIZE. That's the one not working :). If
you leave the code as is the window will resize and my EditText will be
centered above the keyboard. If I uncomment that line of code the mode will
reset to ADJUST_PAN even though I explicitly ask for resizing.
Thanks!

On Tue, Aug 18, 2009 at 7:39 PM, Balwinder Kaur (T-Mobile USA) 
balwinder.k...@t-mobile.com wrote:


 Could you please post your layout xml file to help reproduce the
 problem. Meanwhile...

 this.getWindow().addFlags
 (WindowManager.LayoutParams.FLAG_FULLSCREEN);
 this.getWindow().setSoftInputMode
 (WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

 did work for me for a vertical layout with a bunch of UI elements in
 it.

 Balwinder Kaur
 Open Source Development Center
 ·T· · ·Mobile· stick together

 The views, opinions and statements in this email are those of the
 author solely in their individual capacity, and do not necessarily
 represent those of T-Mobile USA, Inc.


 On Aug 18, 3:04 am, loctarar andrei.bu...@gmail.com wrote:
  Hello!
 
  I've noticed some incompatibility between these two functions.
  public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   this.getWindow().addFlags
  (WindowManager.LayoutParams.FLAG_FULLSCREEN);
   this.getWindow().setSoftInputMode
  (WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
   .
 
  }
 
  Enabling the fullscreen flag seems to disable the soft input adjust
  mode. I looked through the source code of the two functions but I
  coulnd't find anything that might cause this.
 
  Any suggestions?
  Thanks!
 


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



[android-developers] Re: Displaying virtual keyboard

2009-08-14 Thread Andrei Bucur
Hello!
AbsListView implements onCreateInputConnection using an EditText, subclass
of TextView :). My question is how should a custom View implement those
methods so one can display the virtual keyboard.
Andrei.

On Fri, Aug 14, 2009 at 6:23 PM, greg sep...@eduneer.com wrote:


 I put the following menu option in my application to display the
 keyboard:

case R.id.keyboard:
Toast.makeText(this, Back button removes keyboard.,
 Toast.LENGTH_SHORT).show();
InputMethodManager imm =
 (InputMethodManager)getSystemService
 (Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(mListView,
 InputMethodManager.SHOW_FORCED);
return true;

 - - -

 I hope that helps.

 - Greg


 On Aug 14, 8:58 am, loctarar andrei.bu...@gmail.com wrote:
  Hello!
 
  I need help with showing the integrated virtual keyboard on-screen. I
  extended a View class and I implemented these two methods (most of it
  is just stub code; for now I only want to display the keyboard):
  @Override
  public InputConnection onCreateInputConnection (EditorInfo
 outAttrs)
  {
  BaseInputConnection fic = new BaseInputConnection(this,
 true);
 
  outAttrs.actionLabel = null;
  outAttrs.hintText = Insert the test text;
  outAttrs.initialCapsMode = 0;
  outAttrs.initialSelEnd = outAttrs.initialSelStart = -1;
  outAttrs.label = Test text;
  outAttrs.inputType = InputType.TYPE_CLASS_NUMBER |
  InputType.TYPE_NUMBER_FLAG_DECIMAL;
  outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
 
  return fic;
  }
 
  @Override
  public boolean onCheckIsTextEditor() {
  return true;
  }
 
  In the onCreate method of my activity I have :
 
  InputMethodManager imm =
 (InputMethodManager)this.getSystemService
  (Context.INPUT_METHOD_SERVICE);
  imm.showInputMethodPicker();
 
  imm.showSoftInput(editor, InputMethodManager.SHOW_FORCED);
 
  Where editor is an instance of my View. I noticed in the debugger that
  my onCreateInputConnection() is executed but after that the keyboard
  is not displayed on the screen.
  Using the TextView widtget and it's subclasses is not an option.
 
  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
-~--~~~~--~~--~--~---



[android-developers] Re: Displaying virtual keyboard

2009-08-14 Thread Andrei Bucur
Thanks! You have a gift to wake me up from stupidity :). I actually
implemented everything correctly, except that I've made the uber obvious
mistake to call the IM in the onCreate() function of the activity. I guess I
should have used at least onWindowFocusChanged(). Sorry for wasting your
time.

On Fri, Aug 14, 2009 at 7:55 PM, Dianne Hackborn hack...@android.comwrote:

 Do the same thing TextView does.

 On Fri, Aug 14, 2009 at 8:33 AM, Andrei Bucur andrei.bu...@gmail.comwrote:

 Hello!
 AbsListView implements onCreateInputConnection using an EditText, subclass
 of TextView :). My question is how should a custom View implement those
 methods so one can display the virtual keyboard.
  Andrei.

 On Fri, Aug 14, 2009 at 6:23 PM, greg sep...@eduneer.com wrote:


 I put the following menu option in my application to display the
 keyboard:

case R.id.keyboard:
Toast.makeText(this, Back button removes keyboard.,
 Toast.LENGTH_SHORT).show();
InputMethodManager imm =
 (InputMethodManager)getSystemService
 (Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(mListView,
 InputMethodManager.SHOW_FORCED);
return true;

 - - -

 I hope that helps.

 - Greg


 On Aug 14, 8:58 am, loctarar andrei.bu...@gmail.com wrote:
  Hello!
 
  I need help with showing the integrated virtual keyboard on-screen. I
  extended a View class and I implemented these two methods (most of it
  is just stub code; for now I only want to display the keyboard):
  @Override
  public InputConnection onCreateInputConnection (EditorInfo
 outAttrs)
  {
  BaseInputConnection fic = new BaseInputConnection(this,
 true);
 
  outAttrs.actionLabel = null;
  outAttrs.hintText = Insert the test text;
  outAttrs.initialCapsMode = 0;
  outAttrs.initialSelEnd = outAttrs.initialSelStart = -1;
  outAttrs.label = Test text;
  outAttrs.inputType = InputType.TYPE_CLASS_NUMBER |
  InputType.TYPE_NUMBER_FLAG_DECIMAL;
  outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
 
  return fic;
  }
 
  @Override
  public boolean onCheckIsTextEditor() {
  return true;
  }
 
  In the onCreate method of my activity I have :
 
  InputMethodManager imm =
 (InputMethodManager)this.getSystemService
  (Context.INPUT_METHOD_SERVICE);
  imm.showInputMethodPicker();
 
  imm.showSoftInput(editor, InputMethodManager.SHOW_FORCED);
 
  Where editor is an instance of my View. I noticed in the debugger that
  my onCreateInputConnection() is executed but after that the keyboard
  is not displayed on the screen.
  Using the TextView widtget and it's subclasses is not an option.
 
  Thank you!







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



[android-developers] Re: Incredible bug reading a network stream

2009-08-11 Thread Andrei Bucur
InputStream.read(buffer) doesn't guarantee you'll read exactly buffer.length
bytes. You must use the value returned by read to actualy see how much was
read.

On Tue, Aug 11, 2009 at 9:51 PM, Vermouth ggauthier@gmail.com wrote:


  you have to check how many bytes in.read() actually read
 Hum...
 I don't understand ^^ ! Sorry ^^ !

 After in.read(buffer);, in stop reading ! And it have read
 buffer_size bytes !
 


--~--~-~--~~~---~--~~
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: add an activity pragmatically in Menifest.xml

2009-08-10 Thread Andrei Bucur
This is how I make libraries for Android in Eclipse:
1. I make a new Java project
2. In the project properties, at Java Build Path - Libraries, I replace the
the JDK library with the android.jar, found in the Android SDK.
From what I tested, this solution seems to work.

On Mon, Aug 10, 2009 at 2:54 PM, Atif atif.gul...@gmail.com wrote:


 Hi,

 I want to run an activity without adding it in Menifest.xml file. Is
 it possible? and how?

 Actually I am developing a component (Library) that other users can
 plugged with their programs.


 Best regards,
 Atif
 


--~--~-~--~~~---~--~~
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: Folder issues

2009-07-30 Thread Andrei Bucur
UPDATE2: I manually uninstalled the package on the phone and then launched
again the debugger in eclipse. Now it works :|. If someone has a possible
explanation for this please feel free to share. My guess is that sometime in
the development process I used the path to create a file (not a folder) and
the getDir function doesn't detect this.

On Thu, Jul 30, 2009 at 11:07 AM, loctarar andrei.bu...@gmail.com wrote:


 UPDATE: IT works on the emulator, but not on the device. The OS is up
 to date. I can't figure out why it's not functioning properly.on the
 physical device (T-Mobile G1).

 On Jul 30, 10:41 am, loctarar andrei.bu...@gmail.com wrote:
  Hello!
 
  I have the following piece of code:
 
  File recordDir = currentContext.getDir(recordPath,
  Context.MODE_PRIVATE);
  ...
  String[] fileList = recordDir.list();
 
  I surrounded the getDir call with try/catch blocks and seems to
  succede. However, fileList is null. Also, recordDir.exists() returns
  true but recordDir.isDirectory() returns false. Is this normal?
 
  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
-~--~~~~--~~--~--~---