[android-developers] Re: Low Latency Audio is gettting worse not better

2012-01-19 Thread bdk
here:

http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/
(Round 4: Latency)

On Jan 19, 9:07 am, Doug beafd...@gmail.com wrote:
 What numbers?  What are you running and how?  Can I duplicate your
 findings using standard dev tools?

--
bdk

-- 
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: 3D Engine

2011-10-24 Thread bdk
hi, check out http://unity3d.com/unity/publishing/android.html

--
Mathieu

On Oct 24, 12:26 pm, muizz syedmu...@gmail.com wrote:
 Assalam o aliukum.
 I am a student of BS-Computer Science.
 I want to make 3D android game on poultry form.
 I want to discuss that what is the best tool for 3D graphics handling
 and what is the suitable 3D engine in Android?
 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: HTC and LG haven't implemented Android in the right way

2011-10-10 Thread bdk
for a brighter result, try to use use additive blending:

 glBlendFunc(GL_SRC_ALPHA, GL_ONE)

e.g. 
http://stackoverflow.com/questions/393785/how-to-setup-blending-for-additive-color-overlays

and yes, alpha should be in the png - texture.

best

--
Mathieu

On Oct 8, 11:08 am, MobileVisuals eyv...@astralvisuals.com wrote:
 How do you mean that I should put brightness level in the textures? I
 have already enabled transparency with

 gl.glEnable(GL10.GL_BLEND);
 gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
 gl.glColor4f(1f, 1f, 1f, 0.25f);

 I see that the transparency have effect, but it doesn't work as well
 as it should. I have also noticed that the black square quads are
 visible. Do you know what I can do to get rid of the black square
 quads? Is there any way to make it as shiny and smooth as it was with
 point sprites?

 I use this call to draw the quads:

 gl.glDrawElements(GL10.GL_TRIANGLES, vertices*2,
 GL10.GL_UNSIGNED_SHORT,indiceBuffer);

 I don't think that I can use glDrawArrays,because that is for
 TriangleStripArrays. I have 1200 particles, which makes it 4800
 vertices in the array for the quads. The positions are morphed for
 each repaint. Maybe that is what is making it slow,but it was fast
 with point sprites.

 Each star particle consists of 2 quads. The star particle in the
 middle is smaller quad.  The transparent blueish blur around that
 particle is another quad. These are drawn with 2  arrays. I draw the
 most opaque array first (the star particle in the middle) and then the
 more transparent array later. This approach worked very well with
 point sprites and size attenuation, but maybe this doesn't work with
 texture mapped quads. Maye there are simply too much quads for the
 system to take care off, which messes up the Depth Testing and the z
 buffer. Maybe this is the reason that the transparency is not working
 like it should, which causes the visible black square quads?

 On Oct 7, 4:58 pm, Kostya Vasilyev kmans...@gmail.com wrote:







  Looking at the dull screenshot, I can see that your sprites are wrong
  - they don't have transparency around the point itself.

  The black square quads are clearly visible, and they shouldn't be.

  The brightness level is what you put in the textures, you should be able
  to make them as bright as you want.

  As for performance, I haven't done any 3D work specifically on Android
  devices, so can't say for sure. Using glDrawArrays should help, does it not?

  -- Kostya

  07.10.2011 17:44, MobileVisuals пишет:

   I have implemented this according to your approach now. I replaced
   attenuated points with texture mapped quads.  I implemented bilinear
   filtering and alpha test.
   It works, but the visual quality is not good. It doesn't look at all
   as good as with Point sprites and size attenuation. It looked shiny
   and smooth when I used Point sprites and size attenuation and it was
   fast:
  http://www.mobile-visuals.com/mgw.php

   Now it is just rough and dull and it is slow:
  http://www.mobile-visuals.com/dull.png

   Are you really sure that is possible to get good visual quality with
   your approach?

   On Sep 29, 9:26 pm, Kostya Vasilyevkmans...@gmail.com  wrote:
   29.09.2011 23:01, MobileVisuals ?:

   I claim that HTC HD doesn't support OpenGL ES 2.0, because size
   attenuation is a part of OpenGL ES 1.1 and it is not supported.
   Quite possibly, you're right...

   So HTC hasn't implemented the things that they say in the
   specification, but why not?
   Who knows?

   You could contact their support, but even if they provide a plausible
   answer (and that's a big if), it's not going to magically fix all the
   HTC devices out there...

   Thanks for the idea, do you mean like this?
   Scale to small size if the sprite is far away.
   Scale to medium size if the sprite is medium distance.
   Scale to big size if the sprite is close.
   More or less - you are currently doing continuous range scaling of your
   sprites (I presume). If you replace them with texture mapped quads, you
   could always use the same image, or pick one of the ones predefined at
   various scale factors, to improve the image quality and performance.
   Sort of like mip-mapping.

   But that's not the core idea - the main thing is to replace attenuated
   points with texture mapped quads.

   That could work for other animations, but it would be very slow for my
   star cluster animations. There are hundreds of stars in each cluster.
   As it is now, I draw each star cluster in one single glDrawArrays
   call. That makes it fast.
   Hundreds doesn't sound too bad - at those poly counts, it's the fill
   rate (overdraw) that can kill performance. But since sprites are
   typically small, it probably won't be an issue.

   Wouldn't I have to make one glDrawArrays call for each one of the
   stars if I had to scale them in different sizes? That would mean
   hundreds of glDrawArrays calls instead of one.
   Not the 

[android-developers] Re: Android 2.2: WebView shouldOverrideUrlLoading() and custom file download from a phpBB forum

2011-10-03 Thread bdk
Hi

So, the solution was to extract the filename from
setDownloadListener()
and to manage the download with an AsyncTask using an
HttpUrlConnection.

8 - - - - - - -  [from the AsyncTask doInBackground() method]
...

// Store call parameters
URL url = new URL(params.source_url);
String target_file_path = params.destination_file_path;

// Open the URL
HttpURLConnection uconn = (HttpURLConnection)url.openConnection();
uconn.setConnectTimeout(2);
uconn.setReadTimeout(1);
uconn.setDoInput(true);
uconn.connect();

// used later to update a 0-100% progress bar
int lenghtOfFile = uconn.getContentLength();

// downlod the file
BufferedInputStream input = new BufferedInputStream(url.openStream(),
8192);
OutputStream os = new FileOutputStream(target_file_path);
BufferedOutputStream output = new BufferedOutputStream(os, 8192);
...
8 - - - - - - -

best :)

--
Mathieu



On Sep 30, 2:31 pm, bdk mathieu.b...@gmail.com wrote:
 Ok, I'm possibly a step closer to the solution:

 (thanks to this 
 post:http://groups.google.com/group/android-developers/browse_thread/threa...
 )

 mWebView.setDownloadListener(new DownloadListener()
 {
     public void onDownloadStart(String url, String userAgent,
             String contentDisposition, String mimetype,
             long contentLength)
     {
         Log.i(OF, onDownloadStart():  +  url =  + url );
         Log.i(OF,  userAgent =  + userAgent );
         Log.i(OF,  contentDisposition =  + contentDisposition );
         Log.i(OF,  mimetype =  + mimetype );
         Log.i(OF,  contentLength (KB) =  + (contentLength /
 1024.0) );
     }

 });

 from this one I can retrieve an easier to parse
 contentDisposition (no cryptic symbols/encodings)

 now the question is: how do I move on to starting a custom download?
 I'll show a progress-bar and the file will be downloaded to
 apredefined folder.

 Is there any other higher level function available or shall I base the
 download code on HTTP Get?

 thanks

 --
 Mathieu

 On Sep 30, 1:21 pm,bdkmathieu.b...@gmail.com wrote:







  Hi

  I'm in the following situation: I'm using a WebView in an application
  to allow the download of files stored in a phpBB forum.
  I need to directly handle the downloads, saving the files to the
  application folders with their original names.

  I'm bound to Android 2.2 Froyo, so no DownloadManager (if it even
  helps:http://www.vogella.de/blog/2011/06/14/android-downloadmanager-example/
  ).

  So, the problem is that the download links for the files are like
  this:

   http://mywebsite.com/download/file.php?id=123

  These links get caught by shouldOverrideUrlLoading(), but I can't
  handle the download in a custom way since there's no actual file path
  and name on the server.

  I tried to use an HttpURLConnection and checked the returned headers.
  I located the file name in the Content-disposition header value,
  which is something like:

  attachment; filename*=UTF-8''the%20file%20name%20on%20the%20server.aaa

  Seems like phpBB generates this HTML response header here:
   https://github.com/phpbb/phpbb3/blob/develop/phpBB/download/file.php#...
  which refers to:
   https://github.com/phpbb/phpbb3/blob/develop/phpBB/includes/functions...
    more 
  specificallyhttps://github.com/phpbb/phpbb3/blob/develop/phpBB/includes/functions...

  So, WebView alone does not seem able to handle this kind of Content-
  disposition HTTP response header.

  It must be noted that these phpBB file.php?id=123 links do work in
  the BrowserActivity that comes with each Android OS, and the correct
  file name pops up in the save as... dialog.

  ATM I'm digging in BrowserActivity.java present in Android's
  sourcecode repository...

  I saw that I might be good to go by using the InputStream returned by
  an HttpURLConnection, as in e.g.:

   http://getablogger.blogspot.com/2008/01/android-download-image-from-s...
   http://www.helloandroid.com/tutorials/how-download-fileimage-url-your...

  In the case that this is the only solution a question remains: how do
  I retrieve the original filename?
  Parsing the Content-disposition header value? :S

  any hint is appreciated!
  thanks

  --
  Mathieu

-- 
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 2.2: WebView shouldOverrideUrlLoading() and custom file download from a phpBB forum

2011-09-30 Thread bdk
Hi

I'm in the following situation: I'm using a WebView in an application
to allow the download of files stored in a phpBB forum.
I need to directly handle the downloads, saving the files to the
application folders with their original names.

I'm bound to Android 2.2 Froyo, so no DownloadManager (if it even
helps: http://www.vogella.de/blog/2011/06/14/android-downloadmanager-example/
).

So, the problem is that the download links for the files are like
this:

 http://mywebsite.com/download/file.php?id=123

These links get caught by shouldOverrideUrlLoading(), but I can't
handle the download in a custom way since there's no actual file path
and name on the server.

I tried to use an HttpURLConnection and checked the returned headers.
I located the file name in the Content-disposition header value,
which is something like:

attachment; filename*=UTF-8''the%20file%20name%20on%20the%20server.aaa

Seems like phpBB generates this HTML response header here:
 https://github.com/phpbb/phpbb3/blob/develop/phpBB/download/file.php#L324
which refers to:
 
https://github.com/phpbb/phpbb3/blob/develop/phpBB/includes/functions_download.php#L120
  more specifically 
https://github.com/phpbb/phpbb3/blob/develop/phpBB/includes/functions_download.php#L191


So, WebView alone does not seem able to handle this kind of Content-
disposition HTTP response header.


It must be noted that these phpBB file.php?id=123 links do work in
the BrowserActivity that comes with each Android OS, and the correct
file name pops up in the save as... dialog.


ATM I'm digging in BrowserActivity.java present in Android's
sourcecode repository...

I saw that I might be good to go by using the InputStream returned by
an HttpURLConnection, as in e.g.:

 
http://getablogger.blogspot.com/2008/01/android-download-image-from-server-and.html
 http://www.helloandroid.com/tutorials/how-download-fileimage-url-your-device

In the case that this is the only solution a question remains: how do
I retrieve the original filename?
Parsing the Content-disposition header value? :S


any hint is appreciated!
thanks

--
Mathieu

-- 
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 2.2: WebView shouldOverrideUrlLoading() and custom file download from a phpBB forum

2011-09-30 Thread bdk
Ok, I'm possibly a step closer to the solution:

(thanks to this post: 
http://groups.google.com/group/android-developers/browse_thread/thread/d6f8b55cf7b5bc6
)

mWebView.setDownloadListener(new DownloadListener()
{
public void onDownloadStart(String url, String userAgent,
String contentDisposition, String mimetype,
long contentLength)
{
Log.i(OF, onDownloadStart():  +  url =  + url );
Log.i(OF,  userAgent =  + userAgent );
Log.i(OF,  contentDisposition =  + contentDisposition );
Log.i(OF,  mimetype =  + mimetype );
Log.i(OF,  contentLength (KB) =  + (contentLength /
1024.0) );
}
});

from this one I can retrieve an easier to parse
contentDisposition (no cryptic symbols/encodings)

now the question is: how do I move on to starting a custom download?
I'll show a progress-bar and the file will be downloaded to
apredefined folder.

Is there any other higher level function available or shall I base the
download code on HTTP Get?

thanks

--
Mathieu

On Sep 30, 1:21 pm, bdk mathieu.b...@gmail.com wrote:
 Hi

 I'm in the following situation: I'm using a WebView in an application
 to allow the download of files stored in a phpBB forum.
 I need to directly handle the downloads, saving the files to the
 application folders with their original names.

 I'm bound to Android 2.2 Froyo, so no DownloadManager (if it even
 helps:http://www.vogella.de/blog/2011/06/14/android-downloadmanager-example/
 ).

 So, the problem is that the download links for the files are like
 this:

  http://mywebsite.com/download/file.php?id=123

 These links get caught by shouldOverrideUrlLoading(), but I can't
 handle the download in a custom way since there's no actual file path
 and name on the server.

 I tried to use an HttpURLConnection and checked the returned headers.
 I located the file name in the Content-disposition header value,
 which is something like:

 attachment; filename*=UTF-8''the%20file%20name%20on%20the%20server.aaa

 Seems like phpBB generates this HTML response header here:
  https://github.com/phpbb/phpbb3/blob/develop/phpBB/download/file.php#...
 which refers to:
  https://github.com/phpbb/phpbb3/blob/develop/phpBB/includes/functions...
   more 
 specificallyhttps://github.com/phpbb/phpbb3/blob/develop/phpBB/includes/functions...

 So, WebView alone does not seem able to handle this kind of Content-
 disposition HTTP response header.

 It must be noted that these phpBB file.php?id=123 links do work in
 the BrowserActivity that comes with each Android OS, and the correct
 file name pops up in the save as... dialog.

 ATM I'm digging in BrowserActivity.java present in Android's
 sourcecode repository...

 I saw that I might be good to go by using the InputStream returned by
 an HttpURLConnection, as in e.g.:

  http://getablogger.blogspot.com/2008/01/android-download-image-from-s...
  http://www.helloandroid.com/tutorials/how-download-fileimage-url-your...

 In the case that this is the only solution a question remains: how do
 I retrieve the original filename?
 Parsing the Content-disposition header value? :S

 any hint is appreciated!
 thanks

 --
 Mathieu

-- 
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: Disabling a set of 'reserved characters' from user Input?

2011-09-01 Thread bdk
Ok, so here's the code I'm using ATM:

8 - - - - - - - - -
// InputFilter for file names
// use like this:
//
//   edittext.setFilters(new InputFilter[]{cFilenameInputFilter});

static final InputFilter cFilenameInputFilter = new InputFilter()
{
  public CharSequence filter(CharSequence source, int start, int end,
Spanned dest, int dstart, int dend)
  {
for (int i = start; i  end; i++)
{
  int ch = source.charAt(i);
  boolean is_unicode_punctuation = false;

  switch (Character.getType(ch)) {
case Character.CURRENCY_SYMBOL:
case Character.CONNECTOR_PUNCTUATION:
case Character.FINAL_QUOTE_PUNCTUATION:
case Character.INITIAL_QUOTE_PUNCTUATION:
case Character.DASH_PUNCTUATION:
case Character.START_PUNCTUATION:
case Character.END_PUNCTUATION:
case Character.OTHER_PUNCTUATION:
  is_unicode_punctuation = true;
break;
  }

// check against Forbidden chars:
// 'reverse solidus': 
http://blogs.msdn.com/b/michkap/archive/2005/10/12/479561.
final char reverse_solidus = 0x005c;
final String forbidden_chars = |?*:\+[]/\\ + reverse_solidus;
boolean is_allowed = (forbidden_chars.indexOf(ch) == -1);

boolean is_valid_char = is_allowed 
(Character.isLetterOrDigit(ch) || is_unicode_punctuation);

if(is_valid_char == false)
{
  return ; // ops
}
  }

 return null; // go on, char should be fine
}
};

8 - - - - - - - - -

best

--
Mathieu

On Aug 30, 1:22 pm, Daniel Drozdzewski daniel.drozdzew...@gmail.com
wrote:
 On 30 August 2011 12:17,bdkmathieu.b...@gmail.com wrote:

  A possibly catch-all solution:

   http://download.oracle.com/javase/tutorial/i18n/text/charintro.html

  :)

 Indeed!
 That should work just fine and avoids use of RegEx.

 Thanks!

 --
 Daniel

-- 
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: Disabling a set of 'reserved characters' from user Input?

2011-08-30 Thread bdk
Thanks Chris, that's for sure useful :)

--
Mathieu

On Aug 25, 5:00 pm, Chris crehb...@gmail.com wrote:
 On Thursday, August 25, 2011 4:35:33 AM UTC-4, bdk wrote:

  I'll go hunting for an 'official' list of locale-specific path
  separators...

 There's a constant in java.io.File named 'separator' which gives you the
 localized, system-specific file separator string.

-- 
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: Disabling a set of 'reserved characters' from user Input?

2011-08-30 Thread bdk
Hmm... Daniel, that's for sure the best approach!

This one looks like nice option (using InputFilter):

 
http://stackoverflow.com/questions/5500060/android-input-type-for-only-non-numeric-chars

--
Mathieu



On Aug 30, 12:07 pm, Daniel Drozdzewski daniel.drozdzew...@gmail.com
wrote:
 On 30 August 2011 10:57, bdk mathieu.b...@gmail.com wrote:

  Thanks Chris, that's for sure useful :)

 Mathieu,

 Instead of doing cat and mouse chase of all possible path separators,
 just define, what characters you allow in a reg-ex. This will be much
 easier, as the file names have quite limited number of allowed chars.

 It is true that System.getProperty(path.separator) or
 File.pathSeparator will store the path separator for current locale.
 But as you see, it will return only the separator for the current
 locale, while you need to filter them all (I think).

 In other words me defining the file path with Japanese Yen or Korean
 Won while in en locale and then quitting your app, changing locale
 to jp or kr and restarting your app could avoid your checks.

 --
 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] Re: Disabling a set of 'reserved characters' from user Input?

2011-08-30 Thread bdk
Ok, here some more resources:

RegExp example:
 
http://www.devdaily.com/blog/post/java/remove-non-alphanumeric-characters-java-string

Windows filenames  paths:
 http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx

 - - -

On the other hand: how to deal with non-latin alphabets?
(that is, allowing Unicode file names? e.g. Japanese, Korean,
Cirillic, Greek, ... filenames?)

See for instance this: http://kourge.net/projects/regexp-unicode-block

Maybe in this case it would still be easier to go for the mouse-cat
solution which apparently is a bit less daunting...

... well, for now I'll stick with alphanumeric RegExp:
- good side: such files would be easier to index if made public
- downside: not everyone in the world knows a latin-alphabet based
language...?

--
Mathieu

On Aug 30, 12:37 pm, bdk mathieu.b...@gmail.com wrote:
 Hmm... Daniel, that's for sure the best approach!

 This one looks like nice option (using InputFilter):

  http://stackoverflow.com/questions/5500060/android-input-type-for-onl...

 --
 Mathieu

 On Aug 30, 12:07 pm, Daniel Drozdzewski daniel.drozdzew...@gmail.com
 wrote:

  On 30 August 2011 10:57, bdk mathieu.b...@gmail.com wrote:

   Thanks Chris, that's for sure useful :)

  Mathieu,

  Instead of doing cat and mouse chase of all possible path separators,
  just define, what characters you allow in a reg-ex. This will be much
  easier, as the file names have quite limited number of allowed chars.

  It is true that System.getProperty(path.separator) or
  File.pathSeparator will store the path separator for current locale.
  But as you see, it will return only the separator for the current
  locale, while you need to filter them all (I think).

  In other words me defining the file path with Japanese Yen or Korean
  Won while in en locale and then quitting your app, changing locale
  to jp or kr and restarting your app could avoid your checks.

  --
  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] Re: Disabling a set of 'reserved characters' from user Input?

2011-08-30 Thread bdk
A possibly catch-all solution:

  http://download.oracle.com/javase/tutorial/i18n/text/charintro.html

:)

--
Mathieu

On Aug 30, 1:11 pm, Daniel Drozdzewski daniel.drozdzew...@gmail.com
wrote:
 On 30 August 2011 11:57, bdk mathieu.b...@gmail.com wrote:

  Ok, here some more resources:

  RegExp example:
   http://www.devdaily.com/blog/post/java/remove-non-alphanumeric-charac...

  Windows filenames  paths:
   http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx

 Good spot Mathieu about Unicode characters!

 You have to build your reg-ex using character classes designed to deal
 with this.

 go to:

 http://download.oracle.com/javase/1,5.0/docs/api/java/util/regex/Patt...

 ...and have a look at 'Classes for Unicode blocks and categories' section.

 \p{L}

 as a reg-ex marks letters regardless of the alphabet/script used.

 --
 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] Re: Disabling a set of 'reserved characters' from user Input?

2011-08-25 Thread bdk
Thanks for your suggestion, Daniel.

Actually it appears to me like a new input method would need to be
implemented (by Google...? :) at least for soft-keyboard, so the user
just sees the allowed keys (just the forbidden ones are not shown).
And, with a flag to enable or disable the path-separator char (fun
read: http://blogs.msdn.com/b/oldnewthing/archive/2005/10/14/481044.aspx
)
On the other hand your suggestion seems like a good (the only?) option
for an hardware keyboard.

I'll go hunting for an 'official' list of locale-specific path
separators...
Maybe it's just Yen, Won and slashes-backslashes...

best

--
Mathieu

On Aug 24, 6:39 pm, Daniel Drozdzewski daniel.drozdzew...@gmail.com
wrote:
 On 24 August 2011 17:05, bdk mathieu.b...@gmail.com wrote:



  Hi

  I'm showing the user a Save as... dialog to save files, and I'd like
  to disable a set of 'reserved characters' into a related EditText
  field.

  Let's say, something like:

   private static final String ReservedChars = |\\?*\:+/'¥;

   (useful read:http://en.wikipedia.org/wiki/Filename)

  I have to be careful not to use chars not compatible with other
  filesystems like Windows (for instance: ? or   would make the file
  unusable in a Win* filesystem)

  Moreover, I don't want the user to be able to put sequences like ../
  or /foo/bar/filename.xxx to access other paths.

  This also brings up another point: _all_ possible filepath separators
  should be forbidden (for instance, ¥ is the filepath separator on
  Japanese locale computers).

  So, what would be the most elegant solution to filter out these
  characters from user input?
  I'm also thinking about automatically replacing the forbidden chars
  with underscores, but it's not really user-friendly.

  I looked 
  intohttp://developer.android.com/reference/android/text/InputType.html
  but something like InputType.TYPE_CLASS_FILE_NAME is missing...

  TYPE_TEXT_VARIATION_URI does not seem an option since apparently the
  soft keyboard ends up containing chars like: / *  ? ¥ and... smileys?

  For now I've tried with:

                 EditText myEditText = new EditText(activity);
                 myEditText.setSingleLine();
                 myEditText.setInputType(InputType.TYPE_CLASS_TEXT |
  InputType.TYPE_TEXT_VARIATION_URI);

  to no luck.

  Now I'm reading 
  across:http://stackoverflow.com/questions/6626283/how-to-use-inputconnection...
  ...

  best

 Just add a listener to EditText.

 In the listener you capture the text change event and filter through
 only allowed characters.
 --
 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] Re: Disabling a set of 'reserved characters' from user Input?

2011-08-25 Thread bdk
This one looks like a good read on the file-path separators question:

  http://blogs.msdn.com/b/michkap/archive/2005/09/17/469941.aspx

--
Mathieu

On Aug 25, 10:35 am, bdk mathieu.b...@gmail.com wrote:
 Thanks for your suggestion, Daniel.

 Actually it appears to me like a new input method would need to be
 implemented (by Google...? :) at least for soft-keyboard, so the user
 just sees the allowed keys (just the forbidden ones are not shown).
 And, with a flag to enable or disable the path-separator char (fun
 read:http://blogs.msdn.com/b/oldnewthing/archive/2005/10/14/481044.aspx
 )
 On the other hand your suggestion seems like a good (the only?) option
 for an hardware keyboard.

 I'll go hunting for an 'official' list of locale-specific path
 separators...
 Maybe it's just Yen, Won and slashes-backslashes...

 best

 --
 Mathieu

 On Aug 24, 6:39 pm, Daniel Drozdzewski daniel.drozdzew...@gmail.com
 wrote:

  On 24 August 2011 17:05,bdkmathieu.b...@gmail.com wrote:

   Hi

   I'm showing the user a Save as... dialog to save files, and I'd like
   to disable a set of 'reserved characters' into a related EditText
   field.

   Let's say, something like:

    private static final String ReservedChars = |\\?*\:+/'¥;

    (useful read:http://en.wikipedia.org/wiki/Filename)

   I have to be careful not to use chars not compatible with other
   filesystems like Windows (for instance: ? or   would make the file
   unusable in a Win* filesystem)

   Moreover, I don't want the user to be able to put sequences like ../
   or /foo/bar/filename.xxx to access other paths.

   This also brings up another point: _all_ possible filepath separators
   should be forbidden (for instance, ¥ is the filepath separator on
   Japanese locale computers).

   So, what would be the most elegant solution to filter out these
   characters from user input?
   I'm also thinking about automatically replacing the forbidden chars
   with underscores, but it's not really user-friendly.

   I looked 
   intohttp://developer.android.com/reference/android/text/InputType.html
   but something like InputType.TYPE_CLASS_FILE_NAME is missing...

   TYPE_TEXT_VARIATION_URI does not seem an option since apparently the
   soft keyboard ends up containing chars like: / *  ? ¥ and... smileys?

   For now I've tried with:

                  EditText myEditText = new EditText(activity);
                  myEditText.setSingleLine();
                  myEditText.setInputType(InputType.TYPE_CLASS_TEXT |
   InputType.TYPE_TEXT_VARIATION_URI);

   to no luck.

   Now I'm reading 
   across:http://stackoverflow.com/questions/6626283/how-to-use-inputconnection...
   ...

   best

  Just add a listener to EditText.

  In the listener you capture the text change event and filter through
  only allowed characters.
  --
  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] Disabling a set of 'reserved characters' from user Input?

2011-08-24 Thread bdk
Hi

I'm showing the user a Save as... dialog to save files, and I'd like
to disable a set of 'reserved characters' into a related EditText
field.

Let's say, something like:

  private static final String ReservedChars = |\\?*\:+/'¥;

 (useful read: http://en.wikipedia.org/wiki/Filename )

I have to be careful not to use chars not compatible with other
filesystems like Windows (for instance: ? or   would make the file
unusable in a Win* filesystem)

Moreover, I don't want the user to be able to put sequences like ../
or /foo/bar/filename.xxx to access other paths.

This also brings up another point: _all_ possible filepath separators
should be forbidden (for instance, ¥ is the filepath separator on
Japanese locale computers).

So, what would be the most elegant solution to filter out these
characters from user input?
I'm also thinking about automatically replacing the forbidden chars
with underscores, but it's not really user-friendly.

I looked into http://developer.android.com/reference/android/text/InputType.html
but something like InputType.TYPE_CLASS_FILE_NAME is missing...

TYPE_TEXT_VARIATION_URI does not seem an option since apparently the
soft keyboard ends up containing chars like: / *  ? ¥ and... smileys?

For now I've tried with:

EditText myEditText = new EditText(activity);
myEditText.setSingleLine();
myEditText.setInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_VARIATION_URI);

to no luck.

Now I'm reading across: 
http://stackoverflow.com/questions/6626283/how-to-use-inputconnectionwrapper
...

best

--
Mathieu

-- 
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: Problem with audio recording

2011-05-18 Thread bdk
hola

http://voiceontheweb.biz/skype/echo-cancellation/
http://en.wikipedia.org/wiki/Echo_cancellation

M.

On May 18, 12:56 pm, neha neha.05...@gmail.com wrote:
 hiii
 I am recording some audio and at the same time playing another.
 but the problem is that ,recorder taking input from both mic and
 speeker.
 I want that recorder only record audio coming from mic not from
 speeker.

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