[android-developers] How do I validate at server side(Login Check in Server Side)

2012-04-19 Thread vamshi ch
hi,

i've login credentials like username and password I need to validate by
server with using json parsing and http request and response so If u know
any onesend me sample code..could u pls help me out...

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] How do I validate at server side(Login Check in Server Side)

2012-04-19 Thread vamshi ch
hi,

i've login credentials like username and password I need to validate by
server with using json parsing and http request and response so If u know
any onesend me sample code..could u pls help me out...

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

Re: [android-developers] Re: Unable to open Html file using intent in deafult browser

2012-04-19 Thread Jovish P
*Mike *, I was not aware about this. From now onwards I will ask my doubts
on StackOverFlow and Android Developers list also.Thanks for pointing this
out. As per Justin we can discuss anything related to Android in this
group. So I think it is not an issue. I think the chances to get reply from
this groups will be less as you said.

*Nadeem Hasan, *

The Web page at ontent://com.android.htmlprovider/sdcard/company
info.html?test/html could not be loaded as: Th request file was not found.
The URL looks malformed to me. The scheme part is ontent? Or is this a
copy/paste issue?


It is a copy/paste issue . Sorry for that. I gone through the link which
you posted.I was not able to find out
the solution in that link. Thanks for your help

*Kostya Vasilyev*

Thanks for pointing out all these points. We are thinking that , only we
are facing this issue.
Android developers are aware about this issue ? Any work around for this
issue ? Please let us know if
 you found out any solution for this.


On Thu, Apr 19, 2012 at 2:16 AM, Kostya Vasilyev kmans...@gmail.com wrote:

  Getting back to the original issue: it's an Android bug.

 Even if the space is encoded properly (as %20) it may not open in the
 built-in HtmlViewer application on some devices.

 This is from my own little app's logcat output:

 04-19 00:38:53.939 I/MimeUtil(23624): Intent: Intent {
 act=android.intent.action.VIEW dat=
 file:///mnt/sdcard/download/test%202.html typ=text/html flg=0x8 }
 04-19 00:38:53.939 I/MimeUtil(23624): Resolved package
 com.android.htmlviewer, name com.android.htmlviewer.HTMLViewerActivity

 The original filename is test 2.html.

 On an Xperia Arc with 2.3.4, the Html viewer comes up, and the window says
 Web page not available.

 It also contains a link that is differnet from what was specified by the
 intent, something like content://com.android.htmlfileprovider/file path
 here?text/html.

 On an HTC Incredible S it's working now, but I received an OTA firmware
 update just recently, and before then, it was also broken.

 It's also broken on my Galaxy Nexus with 4.0.2, so the fix on the
 Incredible S was made by HTC just for their own firmwares.

 On the devices where this fails, an almost identical link but without the
 embedded (and encoded) space works just fine.

 -- K



 On 04/19/2012 12:11 AM, Justin Anderson wrote:

 Jovish, you need to ask these questions elsewhere (like StackOverflow or
 the Android Developers list).


 According to http://developer.android.com/resources/community-groups.html,
 this list is for ANYTHING related to Android.

 *The water cooler of Android discussion. You can discuss just about
 anything Android-related here, ideas for the Android platform,
 announcements about your applications, discussions about Android devices,
 community resources... As long as your discussion is related to Android,
 it's on-topic here.
 *
 But the OP should also be aware that it also says *However, if you have
 a discussion here that could belong on another list, you are probably not
 reaching all of your target audience here and may want to consider shifting
 to a more targeted list.*

 Thanks,
 Justin Anderson
 MagouyaWare Developer
 http://sites.google.com/site/magouyaware


 On Wed, Apr 18, 2012 at 1:34 PM, Nadeem Hasan nha...@nadmm.com wrote:

 Also, see this:


 http://android.stackexchange.com/questions/4775/how-can-i-open-an-html-file-i-have-copied-from-pc-to-sd-card-of-phone

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


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


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


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

[android-developers] HMTL to Android Layout Converter

2012-04-19 Thread rael_yoni
Hi, 
I'm really having hard time with Android layouts, it doesn't have tools 
support (something a designer can work with!) and there are not many 
talented people like you have with HTML/CSS etc.. 

Is there an HTML/CSS to Android Layout Converter?

Thanks,
Yoni

-- 
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: Broadcast receiver receive empty extras

2012-04-19 Thread viktor
Didn't fix my problem, after a long time I still receive an empty
Extras, it is on 2.1.

On 18 Кві, 22:00, TreKing treking...@gmail.com wrote:
 On Wed, Apr 18, 2012 at 1:51 PM, viktor victor.scherb...@gmail.com wrote:
  Yes, I agree with but sometimes an Extras comes with Bundle[{}];

 I don't know what that means.

  You also can take a look to this thread:
 http://groups.google.com/group/android-developers/browse_thread/threa...

 Your link is bad.

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

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


[android-developers] Fwd: Checkbox click fires OnlistItemclick in Custom listview android

2012-04-19 Thread vani reddy
-- Forwarded message --
From: vani reddy vani.reddy.bl...@gmail.com
Date: Wed, Apr 18, 2012 at 6:59 PM
Subject: Checkbox click fires OnlistItemclick in Custom listview android
To: android-developers@googlegroups.com



HI,

In my  custom listview i have checkbox and 3 textviews, The problem is when
i click on checkbox the onlistItem click is fired which i dont want, i want
checkbox state to change when i click on checkbox and  and when i click
outside the checkbox i want the onlistItemclick to be fired.How to acheive
this.
I searched a lot but did not find any solution.Please reply :)

-- 
Regards,
Vani Reddy




-- 
Regards,
Vani Reddy

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

Re: [android-developers] Socket sharing between activities

2012-04-19 Thread Android007
Hi,
I had the same problem as you do (sharing a TCP connection between 
activities) and I must with Dianne that if this is the case then you had 
better use a singleton.
In my case I needed different apps to use one connection. This was not 
possible with a singleton because each app would call a new instance of the 
singleton (as weird as this sounds) even thoug hthe singleton I made was 
inside the Platform. 
Anyway, in my case, I had to use a service (it causes a major degradation 
in speed ), but I wouldn't recommend it


On Tuesday, April 17, 2012 12:26:13 AM UTC+3, Kristopher Micinski wrote:

 I would agree, the best thing for this would be a service that you can
 bind do and do AIDL calls through, along with coordinating other
 things.  Passing the raw socket can be accomplished through the
 application object, though that sounds fairly dirty to me.  This is a
 fairly common use case (in chat clients, etc.., although you
 theoretically shouldn't be this bandwidth heavy..), and one which I
 believe is typically implemented via services.

 On Mon, Apr 16, 2012 at 12:31 PM, Tonez apires...@gmail.com wrote:
  Hi Everyone,
 
  I'm building an Android app which uses TCP sockets to communicate with
  a .net server application.  The android app as a whole relies quite
  heavily on TCP and as such nearly all the features in the app require
  writing to and listening from a socket stream.  I'm trying to
  determine what the best design approach is for having more than one
  activity utilize a live active socket.
 
  I've recently just finished building an iPhone version of this app,
  the way in which I got each feature (different view controllers) to
  use one live active socket connection was by passing the live socket
  instance to each view controller, each view controller would then
  retain ownership of that socket and as such the delegate methods which
  fire when a transmission is received work as expected.  Trying to
  simulate this design in Android is proving to be a pain because I
  can't pass a live socket instance to another activity as part of an
  intent parameter.
 
  If I wanted to have activity A listen for incoming TCP data, and then
  navigate to Activity B but then have activity B send TCP data to
  the .net server and of-course spawn a new thread to listen for
  incoming TCP data - what would be the best approach to achieve this?
 
  At the moment what I have is as follows:  activity A spawns a new
  thread listening for incoming TCP data, activity A can communicate
  with the .net server perfectly fine.  When I navigate to activity B
  and then want to communicate with the .net server - creating a new
  socket instance and then listening for incoming data results in
  activity A's readLine() method receiving the data.  Which makes sense,
  it's still running - but obviously the goal is to have activity B
  receive this data.
 
  An alternative approach I tried was to close down the TCP socket I
  have in activity A when opening up another TCP socket connection when
  I need to use TCP in activity B - although this somewhat works it
  really feels like the wrong way to go about it.
 
  And lastly, one other approach I've thought of is to have one activity
  handling all TCP comms with the .net server and contain all the
  functionality in this one activity by swapping out .xml layout files
  when necessary.  Obviously this will result in one massive .java file
  and again is a route which feels wrong.
 
  Any advice on how I can go about designing my app given that I want to
  use TCP functionality in every activity would be greatly appreciated.
 
  Many thanks,
 
  Tonez
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en


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

[android-developers] Multi Touch issues

2012-04-19 Thread shihab shiha
Hi all,

I am struggling with a multitouch problem. I have two button for getting
two sounds. I tried to enable multi touch for these button. But the problem
is If i hold one button and press the second button i am getting the sound
of the first one.  I have tried many examples but not getting. Any help is
 appreciated

-- 
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: Getting Unable to Instantiate activity; Component ClassNotFound exception

2012-04-19 Thread Lorie Pisicchio
I think this could answer your question
http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17

Regards.

Le jeudi 19 avril 2012 04:29:41 UTC+2, Doug Gordon a écrit :

 I'm suddenly unable to run my app due to this error, where the 
 ClassNotFound refers to my main activity class. It happens on my phone 
 as well as in the emulators in various versions. This is an existing 
 stable app that's been around for quite a while, and I haven't made any 
 code changes since the last time it was working a few weeks ago.

 The only recent changes I've made is that I started a new project in the 
 same workspace and updated the Eclipse components to SDK Tools V19 and 
 SDK Platform Tools V11, plus updating the Eclipse plug-in as indicated. 
 I checked and nothing has changed in my project source directories.

 Any ideas at all of what suddenly broke here?



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

Re: [android-developers] ClassNotFoundException launching app

2012-04-19 Thread Mark Murphy
com.hootsuite.droid.HootApp apparently is not being found. Since you
do not appear to work for them, and since their app is not open source
to the best of my knowledge, the question now is: why are you
attempting to use com.hootsuite.droid.HootApp in *your* app?

On Wed, Apr 18, 2012 at 8:32 PM, Bruce Xia xia...@gmail.com wrote:
 Hey,
 I'm having some weird crash reports from market.

 I have the full class name in my AndroidManifest.xml and we couldn't
 reproduce it on any of our phones. My application. We have around 100k
 users and I'm seeing this report approximately 9/week only.

 Any idea what's happening?

 java.lang.RuntimeException: Unable to instantiate application
 com.test.myApp: java.lang.ClassNotFoundException: com.test.myApp in
 loader dalvik.system.PathClassLoader[/mnt/asec/
 com.hootsuite.droid.full-1/pkg.apk]
 at android.app.LoadedApk.makeApplication(LoadedApk.java:490)
 at
 android.app.ActivityThread.handleBindApplication(ActivityThread.java:
 3715)
 at android.app.ActivityThread.access$2200(ActivityThread.java:132)
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
 1077)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loop(Looper.java:143)
 at android.app.ActivityThread.main(ActivityThread.java:4196)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:507)
 at com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:839)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
 at dalvik.system.NativeStart.main(Native Method)
 Caused by: java.lang.ClassNotFoundException:
 com.hootsuite.droid.HootApp in loader dalvik.system.PathClassLoader[/
 mnt/asec/com.hootsuite.droid.full-1/pkg.apk]
 at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
 at android.app.Instrumentation.newApplication(Instrumentation.java:
 972)
 at android.app.LoadedApk.makeApplication(LoadedApk.java:481)

 
 manifest xmlns:android=http://schemas.android.com/apk/res/android;
    package=com.test.full
    android:versionCode=17400
    android:versionName=1.7.4
    android:installLocation=auto 
  application
        android:name=com.test.myApp
        android:debuggable=true
        android:icon=@drawable/icon_full
 .

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



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

Warescription: Three Android Books, Plus Updates, One Low Price!

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


Re: [android-developers] HMTL to Android Layout Converter

2012-04-19 Thread Mark Murphy
On Thu, Apr 19, 2012 at 3:36 AM, rael_yoni yoni.stoff...@gmail.com wrote:
 I'm really having hard time with Android layouts, it doesn't have tools
 support (something a designer can work with!) and there are not many
 talented people like you have with HTML/CSS etc..

 Is there an HTML/CSS to Android Layout Converter?

No. I doubt such a tool is really possible, at least in terms of
providing you with efficient layouts that will work well as screen
size varies. The reverse (Android layout - HTML/CSS) seems far more
likely.

Have the designer create mockups with detailed layout rules in
Photoshop (or the equivalent), so you can implement Android layout XML
resources based on those specs. There are various PSDs and stencil
kits floating around for this sort of thing.

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

Warescription: Three Android Books, Plus Updates, One Low Price!

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


Re: [android-developers] Re: Broadcast receiver receive empty extras

2012-04-19 Thread TreKing
On Thu, Apr 19, 2012 at 3:04 AM, viktor victor.scherb...@gmail.com wrote:

 Didn't fix my problem, after a long time I still receive an empty Extras,
 it is on 2.1.


You need to explain your problem better. Like what is a long time. What
is different between these times?

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

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

[android-developers] Hidden fragments (and animations) after a rotation

2012-04-19 Thread BoD

Hi!

I have an activity with a fragment that I hide in a transaction with a 
custom animation.

This transaction is added to the back stack.
If I don't rotate the screen this is working as expected (pressing 
'back' un-hides the fragment with the animation)


1/ If I rotate the screen, the fragment is no longer hidden.  I 
discovered that if I call setRetainInstance(true) on the fragment 
however, this problem disappears.  But is this expected and/or 
documented somewhere?


2/ But even if I do that, pressing 'back' shout un-hide the fragment, 
with the custom animation.  However:

 - Not using the support package, on a 3.2 Xoom, the fragment stays hidden.
 - Using the support package, the fragment does become visible again, 
but with no animation.

Is this a (known) bug or did I miss something?

Thanks a lot for your help!

Here is the simple example demonstrating this (replace FragmentActivity 
by Activity and comment/uncomment to switch from using the support 
package or not):


public class MainActivity extends FragmentActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
if (savedInstanceState == null) {
final TestFragment testFragment = new TestFragment();
testFragment.setRetainInstance(true);

final FragmentTransaction ftAdd = 
getSupportFragmentManager().beginTransaction();
// final FragmentTransaction ftAdd = 
getFragmentManager().beginTransaction();

ftAdd.add(R.id.container, testFragment);
ftAdd.addToBackStack(null);
ftAdd.commit();

final FragmentTransaction ftHide = 
getSupportFragmentManager().beginTransaction();
// final FragmentTransaction ftHide = 
getFragmentManager().beginTransaction();
// ftHide.setCustomAnimations(android.R.animator.fade_in, 
android.R.animator.fade_out, android.R.animator.fade_in, 
android.R.animator.fade_out);
ftHide.setCustomAnimations(android.R.anim.fade_in, 
android.R.anim.fade_out, android.R.anim.fade_in, android.R.anim.fade_out);

ftHide.hide(testFragment);
ftHide.addToBackStack(null);
ftHide.commit();
}
}

public static class TestFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup 
container, Bundle savedInstanceState) {

final TextView res = new TextView(getActivity());
res.setText(Fragment);
return res;
}
}
}

--
BoD

--
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] Options menu - icon + text

2012-04-19 Thread Put_tiMe
I am trying to add an options menu:



*code: *
onCreateOptionsMenu()
{
  MenuInflater inflater = getMenuInflater();
  inflater.inflate(R.menu.options_menu, menu);
}


*xml:*
menu xmlns:android=http://schemas.android.com/apk/res/android;

item android:id=@+id/A
  android:icon=@drawable/A
  android:title=
   /

item android:id=@+id/B
  android:icon=@drawable/B
  android:title=B
  /
/menu


Only the image shows up, the 'text' never shows up.
If I don't include the image, then the text shows up fine.

Are they mutually exclusive?


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

Re: [android-developers] Options menu - icon + text

2012-04-19 Thread Mark Murphy
No, they can be used simultaneously on Android 1.x/2.x, but your
images may be too large. Make sure they are sized according to:

http://developer.android.com/guide/practices/ui_guidelines/icon_design_menu.html

On Thu, Apr 19, 2012 at 7:44 AM, Put_tiMe putt...@gmail.com wrote:
 I am trying to add an options menu:



 code:
 onCreateOptionsMenu()
 {
       MenuInflater inflater = getMenuInflater();
       inflater.inflate(R.menu.options_menu, menu);
 }


 xml:
 menu xmlns:android=http://schemas.android.com/apk/res/android;

     item android:id=@+id/A
           android:icon=@drawable/A
           android:title=
            /

     item android:id=@+id/B
           android:icon=@drawable/B
           android:title=B
           /
 /menu


 Only the image shows up, the 'text' never shows up.
 If I don't include the image, then the text shows up fine.

 Are they mutually exclusive?


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



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

Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
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] Reliable private number ID in CallLog

2012-04-19 Thread BouHu
Hello.

I'm looking for a way to separate CallLog entries from private numbers
(i.e Unknown, e.t.c), so i've found in SDK sources file
CallerInfo.java which contains:

public static final String PRIVATE_NUMBER = -2;

Unfortunately seems that several device manufactures change this
value, e.g. Samsung and Sony Ericsson follow this value and i get -2
as a phone number in CallLog entries, but HTC returns -1 instead.
Moreover, CallerInfo.java is not public class so i can't use directly.

So, the question is: Does anyone knows reliable constant which i can
use to separate calls from private numbers?

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] LocationListener Network provider not called

2012-04-19 Thread Fina Perez
Hi all,

I'm facing a really annoying problem. In some point of the program, I
need to track the user position. For that I register a listener for
all the providers available and request updates. This was working
really good until I updated my phone to Android 4.0. But the same code
is working perfectly in older versions.

Now, the listener is not being called. But only under some conditions:

- if i have gps coordinates, this works perfectly ok, even if the gps
coordinates are lost, I get also network
- but if there is no gps coordinates and there is no wifi signal (but
the wifi on the phone is enable), I should be able to get the
coordinates using the 3g. Here is were it's not working. If I debug, I
can see how the listener is being registered but it is never called.

Please, help

-- 
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] bitmap.recycle() and multiple passes through a method question

2012-04-19 Thread Jim Graham
Re-stating (in clearer terms...I think) one remaining question (I think
I have my answer for the rest---we'll see).

Let's say I have a method which is used frequently to do some work on
bitmaps.  If, during that method, I create a temporary bitmap, and then
recycle it, and don't touch it for the remainder of the time in that
pass through that method, but then use it again (and recycle it again)
in anoother pass through that same method, does that then attempt to
re-use the bitmap I recycled in the previous pass?  Or is a new copy
created and recycled in each pass?

And, along with that, once I leave that method, and the temporary
bitmap that's local to that method has not been recycled, is its
memory freed up?  Or does it continue to chew up memory?

Thanks,
   --jim

-- 
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)MiSTie #49997   Running FreeBSD 7.0 
spooky1...@gmail.com ICBM/Hurricane: 30.44406N 86.59909W

  'Wrong' is one of those concepts that depends on witnesses.
 --Catbert:  Evil Director of Human Resources (Dilbert, 05Nov09)

Android Apps Listing at http://www.jstrack.org/barcodes.html

-- 
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: Broadcast receiver receive empty extras

2012-04-19 Thread viktor
I copy My trouble from another thread:

I had a simple app that has Service and Application.
Application starts Service by Action with Intent.

The Service received Intent with onStartCommand and handle some action
by
key that is in Intent.

Sometime Service receives empty Intent.

public void sendRequest(int type, Intent data) {
  Intent i = new Intent(getLocalServiceAction());
  i =
i.putExtras(data).putExtra(LocalApiService.INTENT_NAME_REQUEST_ID,
type);
  startService(i);
}

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
  if (intent != null) {
onHandleIntent(intent);
  }
  return START_REDELIVER_INTENT;
}

protected void onHandleIntent(Intent intent) {
  prepareDataFromReceiver(intent);
}
public void prepareDataFromReceiver(Intent extras) {
  int type =
extras.getIntExtra(LocalApiService.INTENT_NAME_REQUEST_ID, -1);
  //Sometime type doesn't in Intent
  ...
}


I have fixed my problem with service manifest
parameter( android:process=:MyService);


On 19 Кві, 14:18, TreKing treking...@gmail.com wrote:
 On Thu, Apr 19, 2012 at 3:04 AM, viktor victor.scherb...@gmail.com wrote:
  Didn't fix my problem, after a long time I still receive an empty Extras,
  it is on 2.1.

 You need to explain your problem better. Like what is a long time. What
 is different between these times?

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

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


Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-19 Thread Streets Of Boston
First, ignore this sentence below from my previous answer entirely:
 Save the byte[] data from the camera into file directly (this is your 
JPG file).
(It was a left-over chunk of my initial answer)

The 'byte[] data' still takes up memory, because the caller (the Android 
SDK code that calls the onPictureTaken) still has hold of this byte-array. 
Setting data=null won't free that memory because only your code release 
reference to it, not the caller's code.

You can save the raw data of the camera's Bitmap (the bitmap returned from 
decodeByteArray) by calling Bitmap.getPixels a few times (saving the raw 
data in chunks)  or by calling Bitmap.copyPixelsToBuffer.


On Wednesday, April 18, 2012 7:58:36 PM UTC-4, Spooky wrote:

 On Wed, Apr 18, 2012 at 03:59:23PM -0700, Streets Of Boston wrote:
  Dealing with ARGB_ full-sized images may just not be possible for 
  certain devices (e.g. 5MPixel images taking 20Mbyte of memory, not 
 leaving 
  much room for anything else).
  Unless you can decode the byte[] data from the Camera yourself... this 
  would mean writing your own JPG decoder that would allow you to process 
  this byte[] data in smaller chunks, each chunk one at a time. 

 Admittedly, there will probably be some devices that absolutely will face
 limits when using the filters (and probably matrix stuff for brightness
 and contrast adjustments in post, too) that I'm providing in my app.  But
 I am determined to miinimize that to the best extent possible.  My intent
 is to make this a serious camera app, and that means maximizing image
 quality relative to the device's camera.

 What I'm planning to do, after figuring out exactly HOW I'll be doing the
 blending, is to work out the total memory required, and then use either
 getLargeMemoryClass() or getMemoryClass() to find out if the user has it.
 If they simply can't support it, advise them that the original file was
 saved, but the processed one will have to be resized to continue.

 I seem to recall, either yesterday (while I was sick and my mind was
 really foggy) seeing a suggestion, whether in private e-mail or old
 posts, I'm not sure, about saving the jpeg file in chunks, too, and I
 REALLY have no idea how to do that.

  Say you won't write your own decoder. :-)

 You won't write your own decoder.  :-)  (sorry, couldn't resist)


  That leaves you with 2 options:
  - Reduce the image size: Subsample
  - Reduce the image color depth: Dither.

 I'd rather limit size than color.  A smaller, but still having rich, full
 color is far more likely to be accepted than a larger, yet lower-quality
 image.  But I could use a 16-bit (plus Alpha, so somewhere between
 RGB_565 and ARGB_) for the filters.

  Subsample: Create a bitmap from the byte[] data:

 Already doing that for processing with the filters (also bitmaps).

 Side question:  why, after I'm finished with byte[] data, and I set it
 to null, does it still seem to sit there and chew up memory?  Also, on
 a related note, I have a couple of bitmaps in one method that are
 initially re-sized and should be recycled to protect the rest of that
 method (only really matters when handling the BIG bitmaps).  But...when
 I try that, it causes a force close, saying I'm trying to use a bitmap
 that has already been recycled (I'd just copied it to another, and
 was done with the original...not using it again in the current call
 to that method).  Ahy idea what's going on there?

  BitmapFactory.decodeByteArray and set
  BitmapFactory.Options.inSampleSize to value larger than 1 (prefrrably
  to a power of 2)

 Ok, this is something I'm not familiar with.  So does byte[] data
 need to hang around, then?  Or am I creating a bitmap and tossing
 byte[] data?   Sorry if I sound like I have no idea what we're talking
 about on this part, but frankly, I don't.  In the process of getting as
 far as I already am on this app, I've learned *FAR* more (so much it's
 measured on a log scale) about Android programming than in all of my
 previous apps combined...and then some...and I'm still learning, so
 please bear [is that the right spelling in this context?] with me.


  Dither: Create a bitmap from the byte[] data that has the RGB_565 
 encoding 
  and use dithering to avoid banding.

 Again, RGB_565 + Alpha, whatever that is, will work for the filters, but
 not for the photo.  I'd rather limit its size if that's the only option.

  Now you have a Bitmap from the BitmapFactory.decodeByteArray call.

  If creating the other (blending) bitmap would cause OutOfMemory issues, 
  chop up both the camera Bitmap.

 Ok.  I already have the filter bitmap in 640x480.  Is there a way to
 process the larger bitmap pixel-by-pixel, using that smaller one, scaled
 up in the math?  And, how do I blend (add) the color values for each
 pixel?  Or do I enlarge chunks of the smaller bitmap (in relative-sized
 chunks from the small one) to blend with the bigger one?

 And here's a question that might work (or might be an 

[android-developers] Re: bitmap.recycle() and multiple passes through a method question

2012-04-19 Thread Streets Of Boston
After you call bitmap.recycle(), you can no longer use that bitmap at all. 
After calling recycle(), the bitmap still occupies a tiny little bit of 
memory in the DalvikVM. All its raw pixel data memory has been released, 
though. To release that tiny little bit of memory in the DalvikVM as well, 
release the reference to the bitmap (e.g. by doing 'bitmap = null' or by 
just exiting the Java-block that contains 'bitmap' as a local variable) and 
the garbage collector will clean it up later.

When you don't call 'recycle()', the garbage collector will call 
'recycle()' when the bitmap is garbage collected (through the bitmap's 
finalize() method). But since you can't control the garbage collector 
consistently across all types of devices/implementations, calling 
'recycle()' yourself will make sure that the raw pixel data is released at 
your convenience. 

On Thursday, April 19, 2012 9:11:01 AM UTC-4, Spooky wrote:

 Re-stating (in clearer terms...I think) one remaining question (I think
 I have my answer for the rest---we'll see).

 Let's say I have a method which is used frequently to do some work on
 bitmaps.  If, during that method, I create a temporary bitmap, and then
 recycle it, and don't touch it for the remainder of the time in that
 pass through that method, but then use it again (and recycle it again)
 in anoother pass through that same method, does that then attempt to
 re-use the bitmap I recycled in the previous pass?  Or is a new copy
 created and recycled in each pass?

 And, along with that, once I leave that method, and the temporary
 bitmap that's local to that method has not been recycled, is its
 memory freed up?  Or does it continue to chew up memory?

 Thanks,
--jim

 -- 
 THE SCORE:  ME:  2  CANCER:  0
 73 DE N5IAL (/4)MiSTie #49997   Running FreeBSD 7.0 
 spooky1...@gmail.com ICBM/Hurricane: 30.44406N 86.59909W

   'Wrong' is one of those concepts that depends on witnesses.
  --Catbert:  Evil Director of Human Resources (Dilbert, 05Nov09)

 Android Apps Listing at http://www.jstrack.org/barcodes.html



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

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-19 Thread Jim Graham
On Thu, Apr 19, 2012 at 06:25:12AM -0700, Streets Of Boston wrote:
 First, ignore this sentence below from my previous answer entirely:
  Save the byte[] data from the camera into file directly (this is your 
 JPG file).
 (It was a left-over chunk of my initial answer)

Ah, that explains it.  :-)

 The 'byte[] data' still takes up memory, because the caller (the Android 
 SDK code that calls the onPictureTaken) still has hold of this byte-array. 
 Setting data=null won't free that memory because only your code release 
 reference to it, not the caller's code.

Ohhh, yeah, I hadn't thought about that.  Damn.  Not much I can do about
that, then.

 You can save the raw data of the camera's Bitmap (the bitmap returned from 
 decodeByteArray) by calling Bitmap.getPixels a few times (saving the raw 
 data in chunks)  or by calling Bitmap.copyPixelsToBuffer.

That's basically what I came up with.  This basically just flashed across
my brain this morning, and is a combination of ideas I'd been looking at.
It goes something like this:

1) if the device can handle this much, convert the original byte[]
   array to a bitmap (easy).  if not, re-size, notify the user, and
   deal with it.

2) assuming we got past #1, split the file into vertical chunks using

   Bitmap chunk1; // so each can be recycled immediately after use
   Bitmap chunk2;
   
   Bitmap chunkn;
   
   chunk1 = createBitmap(src, 0, 0, width, height/n);

   // save the chunk to a raw data file here

   chunk1.recycle(); chunk1 = null;

   and so on for all n chunks.

3) recycle the original photo image;

4) create the bitmap for the filter and repeat step 2 for it.

5) re-use the bitmap from 4 (or recycle it and make another new one)
   for the combined image, then, one at a time, recover the saved
   bitmap chunks and use paint/canvas to re-build them, and then
   immediately recycle the chunk once it's no longer needed.

6) Save the new photo

But there is one big question...why does recycling the bitmaps after
their last use still result in a force close, saying that I tried to use
them AFTER they were recycled?

Oh, and steps 5 and 6 may need to be done in a new process, if I can
figure out how to do that (or if someone here will point me to the
appropriate reference in the dev guide).

So, how does that sound?

Thanks,
   --jim

-- 
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)| Tux (E Cat):  DS B+Wd Y 6 Y L+++ W+ C++/C++ I+++
spooky1...@gmail.com| T++ A E H+ S V- F++ Q+++ P/P+ B++ PA+ PL SC---
 Running FreeBSD 7.0  | 
ICBM / Hurricane:   | Tiggerbelle:  DS W+S+Bts % 1.5 X L W C+++/C+
   30.44406N 86.59909W  | I+++  T A E++ H S++ V+++ Q+++ P  B++ PA++ PL+ SC

Android Apps Listing at http://www.jstrack.org/barcodes.html

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


Re: [android-developers] Re: bitmap.recycle() and multiple passes through a method question

2012-04-19 Thread Jim Graham
On Thu, Apr 19, 2012 at 06:32:15AM -0700, Streets Of Boston wrote:
 After you call bitmap.recycle(), you can no longer use that bitmap at all. 
 After calling recycle(), the bitmap still occupies a tiny little bit of 
 memory in the DalvikVM. All its raw pixel data memory has been released, 
 though. To release that tiny little bit of memory in the DalvikVM as well, 
 release the reference to the bitmap (e.g. by doing 'bitmap = null' or by 
 just exiting the Java-block that contains 'bitmap' as a local variable) and 
 the garbage collector will clean it up later.

Now, here's the question:  if I return to this method, and re-use the
locally-created bitmaps that are local to that method, is that considered
re-using a bitmap that's already been recycled?  Or is that a fresh chunk
of memory?

 When you don't call 'recycle()', the garbage collector will call 
 'recycle()' when the bitmap is garbage collected (through the bitmap's 
 finalize() method). But since you can't control the garbage collector 
 consistently across all types of devices/implementations, calling 
 'recycle()' yourself will make sure that the raw pixel data is released at 
 your convenience. 

That definitely matches my understanding.  Cool.

Thanks,
   --jim

-- 
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)| DMR: So fsck was originally called
spooky1...@gmail.com|  something else.
 Running FreeBSD 7.0  | Q:   What was it called?
ICBM / Hurricane:   | DMR: Well, the second letter was different.
   30.44406N 86.59909W  |-- Dennis M. Ritchie, Usenix, June 1998.

Android Apps Listing at http://www.jstrack.org/barcodes.html

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


[android-developers] Why the focus changed after I setImageBitmap for imageview

2012-04-19 Thread minilin.11
Problem: After I setImageBitmap for ImageView, the focus reset to the widget on 
top-left corner, why?

Description:
I use FragmentActivity+Fragment for tab. In one of several fragments, I use 
Gallery + ImageView for image browsing.
When a thumbnail is selected, the original image shows in ImageView, 
if I touch the thumbnail, it works fine, but if I switch the focus by keyboard, 
it doesn’t,
When I switch the focus to the next thumbnail by keyboard, the original image 
blinks, 
and then the focus reset to the widget on top-left corner which cause the tab 
switch, 
and another fragment repleace the image browsing fragment.

If I just switch the focus in Gallery and not change the original image,
the reset will not be done.

// These two listener works for gesture and keyboard operation seperately
gallery.setOnItemClickListener(new GalleryItemClickListener());
gallery.setOnItemSelectedListener(new GalleryItemFocusListener());

// and then find out original image and show
currentBitmap = BitmapUtils.queryImageByThumbnailId(Home.this,
application.getThumbnailList().get(index));
currentImage.setImageBitmap(currentBitmap);


Thanks  Best Regards
Lynn Gu
——
MSN: minilin...@hotmail.com
TEL: +86 13501129124
——

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

Re: [android-developers] Re: Someone use GridLayout (ADT-17) in v7?

2012-04-19 Thread Tor Norbye
You have to make sure not just to use 
android.support.v7.widget.GridLayout for the layout itself, but you have 
to use the app namespace for all of its attributes too, since layout_row, 
rowCount etc are not defined in the android namespace for versions older 
than API 14.  As of ADT 17 there's improved handling for library project 
resource namespaces (res-auto), so your layout should look something like 
this:

?xml version=1.0 encoding=utf-8?
android.support.v7.widget.GridLayout 
xmlns:android=http://schemas.android.com/apk/res/android;
xmlns:app=http://schemas.android.com/apk/res-auto;    the 
namespace used for the library project
android:layout_width=match_parent
android:layout_height=match_parent
app:columnCount=6 = notice how we're using app:columnCount 
here, not android:columnCount!

Button
android:id=@+id/button1
app:layout_column=1   === again, note the app: namespace
app:layout_columnSpan=2
app:layout_gravity=left
app:layout_row=1
android:text=Button /

CheckBox
android:id=@+id/checkBox1
app:layout_column=4
app:layout_gravity=left
app:layout_row=2
android:text=CheckBox /

Button
android:id=@+id/button2
app:layout_column=5
app:layout_gravity=left
app:layout_row=3
android:text=Button /

android.support.v7.widget.Space=== space widgets also need the 
full support package path
android:layout_width=21dp === use the android namespace for 
width, height etc -- only use app: for the grid layout library's new 
resources
android:layout_height=1dp
app:layout_column=0
app:layout_gravity=fill_horizontal
app:layout_row=0 /

...

-- Tor


On Thursday, April 5, 2012 7:56:37 AM UTC-7, Siddharth Menon wrote:

 Thanks Tor

 I tried using *android.support.v7.widget.GridLayout* gives me no error 
 but I will not render as grid.
 Has anybody successfully got this working?

 On Wednesday, April 4, 2012 6:56:48 PM UTC+5:30, Tor Norbye wrote:

 You need to use android.support.v7.widget.GridLayout.

 -- Tor

 On Wed, Apr 4, 2012 at 5:02 AM, Siddharth Menon

  Hi,
 
  So finally give GridLayout support for older version.
 
  Added GridLayout project from sdk/extras/android/support/v7/gridlayout
  Added this project as lib to my working project (Target API 7 to 15)
  Now in the XML when I use GridLayout or android.widget.GridLayout I 
 get
  the following error
 
   GridLayout (Change to android.widget.GridLayout, Fix Build Path, Edit 
 XML)
 
  Can somebody please guide me what is that I am doing wrong?
 
 
  Cheers
  Siddharth Menon
 
 
  On Friday, March 23, 2012 12:36:16 AM UTC+5:30, André Luiz R. Silva 
 wrote:
 
  Someone use GridLayout  (ADT-17) in v7?
 
  Errors:
  [GridLayoutTest] ERROR: In declare-styleable GridLayout_Layout, 
 unable
  to find attribute android:layout_marginEnd
  [GridLayoutTest] ERROR: In declare-styleable GridLayout_Layout, 
 unable
  to find attribute android:layout_marginStart
 
  Use sdk/extras/android/support/v7/gridlayout.
 
  --
  Atenciosamente,
 
  André Luiz R. Silva
  @andreronsilva
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to 
 android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en



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

[android-developers] Re: Grant the root privilege to the application

2012-04-19 Thread Chris Stratton
On Wednesday, April 18, 2012 2:19:35 AM UTC-4, Sam wrote:

 Therefore, it needs to be granted the root privilege to run some 
 native functions. 


That would not be possible on a secured android device, ie, it is off topic 
for this group

The code has been built to be a .so by NDK. 


The code to be run as root must be a stand alone executable rather than a 
jni library, so it can run in a new process.  The su hack on some 
unofficial roms does not and can not be made to elevate an application to 
root, all it can do is launch a new process from a stand alone executable 
and have that process run as root and perhaps do things on behalf of your 
app. 

It's not really on topic here as its outside of the capabilities of the 
android sdk but it's been covered numerous times on stack overflow.

-- 
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: tablet is hang due to full internal storage memory

2012-04-19 Thread Chris Stratton
On Thursday, April 12, 2012 11:50:55 PM UTC-4, priya abc wrote:

 Hello,
  
 I run application from eclipse .it installed directly on tablet internal 
 memory storage.that` why it memory is almost full.
 Then I am trying to uninstall it but it is not removing.
 So i just power off the tablet and did power on..but it is not going into 
 home screen ...it showing only starting logo.
 Now What should i do?
  
 It is china tablet 7inch ...model is crane v1.4 somthing like that.


Maybe see if ADB happens to be up?  If so you could open a shell and 
crudely rm some apps (using run-as to remove only debuggable apps if it's a 
secured device) 

You could see if you can boot to a recovery partition which might 
(depending on the recovery author) either give you ADB, or give you the 
choice of wiping the data partition and starting over.

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

Re: [android-developers] Re: Directly accessing the e-mail app.

2012-04-19 Thread Chris Stratton
On Thursday, April 12, 2012 9:59:30 AM UTC-4, MagouyaWare wrote:

 Is there any way I can do it, without going through the chooser?

  
 That goes directly against the core of Android.  You get a chooser if 
 the user has not specified an email app to use as the default.  If they 
 have chosen an email app to use as the default then they will not get a 
 chooser, just like Johan said.


This may be the stock answer, but there's a fairly annoying usability 
oversight in it.  Consider the case where I (as the user) don't want to 
have a default system-wide, but I (still as the user) have decided that I 
always want to use a particular choice when the intent is coming from this 
particular staring application. 

AFAIK, the workaround would be to obtain a list of the possible choices and 
then target one of them with an explicit intent.  As with most attempts to 
patch oversights in the system design, there's some risk in doing this.

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

Re: [android-developers] Re: Directly accessing the e-mail app.

2012-04-19 Thread Justin Anderson

 This may be the stock answer, but there's a fairly annoying usability
 oversight in it.  Consider the case where I (as the user) don't want to
 have a default system-wide, but I (still as the user) have decided that I
 always want to use a particular choice when the intent is coming from this
 particular staring application.


As far as I have been able to tell, this is not what the OP was intending
to do...

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Thu, Apr 19, 2012 at 9:42 AM, Chris Stratton cs07...@gmail.com wrote:

 This may be the stock answer, but there's a fairly annoying usability
 oversight in it.  Consider the case where I (as the user) don't want to
 have a default system-wide, but I (still as the user) have decided that I
 always want to use a particular choice when the intent is coming from this
 particular staring application.

-- 
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: GridLayout Text Clipping using Support Library

2012-04-19 Thread Scott Olcott
Thanks to 
this 
https://groups.google.com/d/msg/android-developers/QgN2B9CdQOo/0xdpwulIdCcJ 
from Tor Norbe I was able to figure out how to get this working.  I think 
then main issue that was causing this to not work was I wasn't using the 
right namespace which should be  xmlns:app=
http://schemas.android.com/apk/res-auto;. 

Here is an example that now works:

?xml version=1.0 encoding=utf-8?

android.support.v7.widget.GridLayout xmlns:android=
http://schemas.android.com/apk/res/android;

  xmlns:app=http://schemas.android.com/apk/res-auto;

  android:layout_width=match_parent

  android:layout_height=match_parent

  app:columnCount=2

  app:useDefaultMargins=true 

  TextView

app:layout_column=0

app:layout_gravity=left

app:layout_row=0

android:text=Label /

  TextView

android:layout_width=0dp

app:layout_column=1

app:layout_gravity=fill_horizontal

app:layout_row=0

android:text=test test test test test test test test test test test 
test test test test test test test /

/android.support.v7.widget.GridLayout

On Thursday, April 12, 2012 9:27:53 AM UTC-6, Scott Olcott wrote:

 Where are you finding the documentation?  The only documentation I have 
 seen is for the GridLayout that comes with ICS.  There is no javadocs for 
 any of the classes under android.support.v7.  There is no source for them 
 in AOSP or any samples that use them that I can find anywhere.

 On Tuesday, April 10, 2012 2:18:02 PM UTC-6, Dave Rozsnyai wrote:

 Same here. GridLayout library hasn't been user friendly. The 
 documentation doesn't make any note of the fact that you need to use 
 your own namespace for columnCount if you are targeting 4.0 and now 
 this... I would advise people to use something else unless then really 
 need the grid. 

 On Apr 10, 9:55 am, Scott Olcott scottolc...@gmail.com wrote: 
  This is happening on Gingerbread and ICS.  When will the source for the 
  support library GridLayout be available in AOSP?  Currently there is no 
 way 
  to debug what is happening because there is no source available. 
  
  
  
  
  
  
  
  On Monday, April 9, 2012 11:28:46 AM UTC-6, Romain Guy (Google) wrote: 
  
   You set the width of GridLayout to wrap_content so it will extend 
 as 
   far as its content can go. 
  
   On Mon, Apr 9, 2012 at 10:24 AM, Scott Olcott  wrote: 
I am using the GridLayout that is in r7 of the support library.  I 
 am 
   having 
an issue with text being clipped at the edge of the screen instead 
 of 
   being 
wrapped.  Here is a layout that reproduces the issue. 
  
android.support.v7.widget.GridLayout 
xmlns:android=http://schemas.android.com/apk/res/android; 
 android:layout_width=wrap_content 
 android:layout_height=wrap_content  
  
TextView 
  android:minWidth=100dp 
  android:text=test123 / 
  
TextView 
android:text=test test test test tes test tes test test 
 test 
   test 
test test test / 
/android.support.v7.widget.GridLayout 
  
When using the ICS version of GridLayout I can just add 
android:layout_width=0dp and 
 android:layout_gravity=fill_horizontal 
   to 
the TextView and it wraps the text instead clipping.  However when 
 I try 
that using the support library GridView the whole TextView 
 disappears.  I 
attached a screenshot from the Graphic Layout view in Eclipse that 
demonstrates what is happening.  It looks like the second TextView 
 is not 
inheriting it's size from it's container but is the same width as 
 the 
device. 
  
Is there a different way to get this to work correctly? 
  
-- 
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 
  
   -- 
   Romain Guy 
   Android framework engineer 
   romain...@android.com



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

[android-developers] ActionBar - customizing

2012-04-19 Thread Neilz
Hi all.

I'm attempting to add custom drawables to the action bar items. I want
to set a drawable as the general bar background, and have a pressed
state drawable for when any of the bar items are clicked.

I've been following Nick Butchers guide here:
http://android-developers.blogspot.co.uk/2011/04/customizing-action-bar.html

Whatever I do, when I press an item, I see the generic light blue
background, not my specified pressed drawable.

Xoom tablet with 3.2 - here's the code basics:

style name=MyTheme parent=@android:style/Theme.Holo.Light
item name=android:actionBarStyle@style/MyActionBar/item
/style

style name=MyActionBar parent=@android:style/
Widget.Holo.Light.ActionBar
item name=android:background@drawable/action_bar_bg/item
item name=android:selectableItemBackground@drawable/
selector_actionbar_bg/item
/style

The selector refers to this:

selector xmlns:android=http://schemas.android.com/apk/res/android;
  android:exitFadeDuration=@android:integer/
config_mediumAnimTime 
item android:state_pressed=true android:drawable=@drawable/
action_bar_bg_press /
item android:state_focused=true android:drawable=@drawable/
action_bar_bg_press /
item android:drawable=@drawable/action_bar_bg_press /
/selector


Help appreciated!

-- 
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] display homescreen after kill all the background process

2012-04-19 Thread Android Developer
Hi All

Can we able to display homescreen after kill all the background process.

android.os.Process.killProcess(android.os.Process.myPid());


Help Appreciated.

-- 
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: Socket sharing between activities

2012-04-19 Thread Tonez
Hi guys,

Thanks to everyone for the prompt responses.  I've studied up on
Services / IntentServices as well as how I would go about using a
Singleton to satisfy my goal and have decided to give both a try to
take the experiential learning route.  I've started with Services and
have managed to get my app working like it should with binding an
activity in view with the Service running my network thread.  I have a
bug though which I'm having trouble resolving in activity 'A' I'm
using the bindService method to start my service so as to communicate
back and forth between the Service and the activity.  I've created my
service connection like so:

private CallBackActivityAInterface _service = null;

private ServiceConnection serviceConnection = new ServiceConnection()
{
public void onServiceConnected(ComponentName className, IBinder
binder) {
 _service = (CallBackActivityAInterface)binder;

_service.registerActivityACallBack(activityACallBack);
}

public void onServiceDisconnected(ComponentName className) {
 _service = null;
}
}

In my onServiceConnected method above I pass in a call back instance
to the service so it can communicate with activity A from the network
worker thread it is running which is waiting for incoming tcp data.
This is what the CallBackActivityAInterface implementation looks like
in activity A:

private CallBackActivityAInterface activityACallBack = new
CallBackActivityAInterface() {

@Override
public void receivedData() {
runOnUiThread(new Runnable() {

@Override
public void run() {
Log.d(DEBUG, hoorah we have a 
response);
}
});
}
};

This works fine, when I invoke _activityACallBack.receivedData() in my
service from within the worker thread that's waiting for tcp data I
get my debug output above.  It's worth noting for clarification sake
that the callback instance I pass in to my
_service.registerActivityACallBack(..) method in my service is
assigned to a global variable of type CallBackActivityAInterface
within my service class.

In activity B I have the same sort of implementation as you see above
where I create it's own service connection instance and pass in a
callback to the service so it can communicate with activity B.  When I
navigate to activity B from activity A, I first unbind my service
connection from the running service in activity A and then use the
bindService method in activity B with it's own service connection.
The issue I'm having is the callback instance I'm sending through to
the service in activity B's onServiceConnected method is null when I
try use it from within the worker thread that is currently running in
the service.  This is the callback implementation I have in activity
B:

private CallBackActivityBInterface _service = null;

private ServiceConnection serviceConnection = new ServiceConnection()
{
public void onServiceConnected(ComponentName className, IBinder
binder) {
 _service = (CallBackActivityBInterface)binder;

_service.registerActivityBCallBack(activityBCallBack);
}

public void onServiceDisconnected(ComponentName className) {
 _service = null;
}
}

private CallBackActivityBInterface activityBCallBack = new
CallBackActivityBInterface() {
@Override
public void receivedDataInActivityB() {
runOnUiThread(new Runnable() {

@Override
public void run() {
Log.d(DEBUG, hoorah we have a response 
in activity B);
}
});
}
};

Stepping through the code reveals that activityBCallBack is not null
when I inspect it within _service.registerActivityBCallBack(..),
however the global variable I assign activityBCallBack to in my
_service.registerActivityBCallBack(..) method is null when I try use
it from within my worker thread that is already running.  Any idea why
this would be null?

I suspect it may be null because the worker thread is started before
activity B has a chance to populate the private global variable with
activityBCallBack so it can be used to communicate with activity B.
But I most certainly do populate the global callback instance the
worker thread is trying to access before it tries to use it.

I've used the following project as a guide:
https://github.com/commonsguy/cw-andtutorials/tree/master/18-LocalService/

Many thanks for the help!

Tonez


On Apr 19, 10:03 am, Android007 androidcomp...@gmail.com wrote:
 Hi,
 I had the same problem as you do (sharing a TCP connection between
 activities) and I must with Dianne that if this is the case then you had
 better use a singleton.
 In my case I needed different apps to use 

[android-developers] Re: Show 3D object on top of camera view (augmented reality)

2012-04-19 Thread santy
I have tried min3d framework (I suppose I can do it with min3d but I
don´t know how) and opengl functions directly as
shown in 
http://stackoverflow.com/questions/3548666/overlay-images-onto-camera-preview-surfaceview,
and it works fine, but what I
want to do is to show a 3d model in 3ds or obj format (any format that
blender can export), and while I show that object I should
see the camera view.
I think this should be easy and many people is trying to do this, but
there is not a good documentation about
this, and this is rare for Google (they should explain this).

I appreciate any response other than the above.
Thank you


On 18 abr, 17:46, TreKing treking...@gmail.com wrote:
 On Wed, Apr 18, 2012 at 7:23 AM, santy 
 santiago.gonzalez.iz...@gmail.comwrote:

   I haven´t found anything that works fine. Please, if someone knows how to
  do it, please explain it to me (sample code would be perfect)

 What have you tried? What doesn't work? You need to be a tad bit more
 specific.http://www.catb.org/~esr/faqs/smart-questions.html

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

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


Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-19 Thread JackN
it ok, youll get it. you just have some conceptual errors.

On Wednesday, April 18, 2012 3:20:56 PM UTC-7, Spooky wrote:

 On Wed, Apr 18, 2012 at 03:02:41PM -0700, JackN wrote:
  Depends on your depth. For 3 bytes per color (24 bit color), a 2592x1944 
  is  15 MEGABYTES. 

 Again ... READ THE FOLLOWING (with corrected units): 

   On Wed, Apr 18, 2012 at 12:50:41PM -0700, JackN wrote: 
  
350 kB jpg? in memory, that could be huge. perhaps even 20 or more 
 MB 
  
   [corrected units in the above ... I've never actually SEEN anything 
 that
   can store data in millibits, nor have I seen file sizes meansured in 
 bits] 

 Now let's come back to this. 

  Depends on your depth. For 3 bytes per color (24 bit color), a 2592x1944 
  is  15 MEGABYTES. 

 Well, then, since I was replying to the above post, and we're
 side-tracked by jpegs, not the bitmaps that I'm asking about how best to
 handle to allow full resolution (if that's even possible), if the above
 is true, then ARGB_ must not be 24-bit color, because again, NONE of
 my 5 MP ARGB_ photos have been over around 1.3--1.4 MB.  Note that
 I did NOT say 15 MB.  And if that IS true, the developer's guide needs
 to be corrected, because I seem to recall it saying that ARGB_ IS
 24-bit color.  Personally, though, I think your jpeg size of 15 MB is
 on the high end, and the dev guide is right. 

 Again, just to make sure...I was responding to a post about JPEG sizes,
 NOT BITMAP SIZES.  And I am NOT pulling these file sizes out of my ass,
 I'm getting them directly from jpeg images in /mnt/sdcard/DCIM/camera. 

 Later,
--jim 

 -- 
 THE SCORE:  ME:  2  CANCER:  0
 73 DE N5IAL (/4)| Peter da Silva:  No, try rm -rf /
 spooky1...@gmail.com| Dave Aronson:As your life flashes before
  Running FreeBSD 7.0  |  your eyes, in the unit of time known as an
 ICBM / Hurricane:   |  ohnosecond (alt.sysadmin.recovery)
30.44406N 86.59909W  | 

 Android Apps Listing at http://www.jstrack.org/barcodes.html 

 

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

Re: [android-developers] Re: Show 3D object on top of camera view (augmented reality)

2012-04-19 Thread TreKing
On Thu, Apr 19, 2012 at 12:54 PM, santy
santiago.gonzalez.iz...@gmail.comwrote:

 I have tried min3d framework (I suppose I can do it with min3d but I don´t
 know how)


You would learn this framework then use its functionality to do what you
need.


 and opengl functions directly as shown in
 http://stackoverflow.com/questions/3548666/overlay-images-onto-camera-preview-surfaceview,
  and
 it works fine


If that works fine, what is the problem?


 but what I want to do is to show a 3d model in 3ds or obj format (any
 format that blender can export), and while I show that object I should see
 the camera view.


OK. That tell everyone what you want to do. It does not tell anyone what
you have tried to do to solve this problem of yours, nor what specifically
you are stuck on.

I think this should be easy


Why?


  and many people is trying to do this


Like who? Have you asked them for help?


 , but there is not a good documentation about this, and this is rare for
 Google (they should explain this).


Why is it Google's responsibility to document some very specific
functionality that you're trying to accomplish?

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

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

Re: [android-developers] Re: Show 3D object on top of camera view (augmented reality)

2012-04-19 Thread Raghav Sood
Afraid to be the one to break it to you, but your research isn't very
thorough. AndAR does exactly what you want. In fact, one of their code
sample projects is a perfect carbon copy of what you want. Loading 3d
models over a camera preview that are exported from blender in .obj formats.

http://code.google.com/p/andar

Thanks

--
Raghav Sood
https://market.android.com/developer?pub=Appaholics
http://www.appaholics.in/

-- 
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 can I implement AB repeat function using mediaplayer

2012-04-19 Thread Chris Stratton
On Wednesday, April 18, 2012 10:46:21 PM UTC-4, SH wrote:

 Hi all. 

 I try to develop an audio player and would like to have A-B repeat 
 function. When a user click A button while playing, it memorise 
 starting position and clicking B button, it will save ending position. 
 So it repeat A to B points until the user clear repeat position. 
 It is easy to go back to the starting position B but not easy for 
 endping position B because there is not listener to track when it 
 arrived to the marked point. 
 I look forward to your idea. 
 Thanks in advance.


It's been a couple months since I was working on something similar, but 
your options would likely be something along the lines of either 
piggybacking off of the progress bar updates (if possible) or using a 
thread to poll the position of the player.  When either of those methods 
indicates you are at or past your end point, seek to the desired start 
point again.  

Unfortunately, I'm not aware of a play until interface.

 

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

Re: [android-developers] Re: Socket sharing between activities

2012-04-19 Thread Federico Paolinelli
Can't say what's happening, but:

if you took inspiration from there, you are creating the service as
auto_create, which means that it stays around unless there are no
bound activities anymore. Assuming that you are unbinding it on the
onDestroy, the thread contained in the service may be still running
(an thus, receiving data) during the transition from A to B.

Remember also that if you don't unregister the activity A callback,
it will kept being called even if activity A is not visible anymore.

 Sorry I couldn't help anymore,

  Federico

On Thu, Apr 19, 2012 at 7:47 PM, Tonez apires...@gmail.com wrote:
 Hi guys,

 Thanks to everyone for the prompt responses.  I've studied up on
 Services / IntentServices as well as how I would go about using a
 Singleton to satisfy my goal and have decided to give both a try to
 take the experiential learning route.  I've started with Services and
 have managed to get my app working like it should with binding an
 activity in view with the Service running my network thread.  I have a
 bug though which I'm having trouble resolving in activity 'A' I'm
 using the bindService method to start my service so as to communicate
 back and forth between the Service and the activity.  I've created my
 service connection like so:

 private CallBackActivityAInterface _service = null;

 private ServiceConnection serviceConnection = new ServiceConnection()
 {
    public void onServiceConnected(ComponentName className, IBinder
 binder) {
         _service = (CallBackActivityAInterface)binder;

        _service.registerActivityACallBack(activityACallBack);
    }

    public void onServiceDisconnected(ComponentName className) {
         _service = null;
    }
 }

 In my onServiceConnected method above I pass in a call back instance
 to the service so it can communicate with activity A from the network
 worker thread it is running which is waiting for incoming tcp data.
 This is what the CallBackActivityAInterface implementation looks like
 in activity A:

 private CallBackActivityAInterface activityACallBack = new
 CallBackActivityAInterface() {

                @Override
                public void receivedData() {
                        runOnUiThread(new Runnable() {

                                @Override
                                public void run() {
                                        Log.d(DEBUG, hoorah we have a 
 response);
                                }
                        });
                }
 };

 This works fine, when I invoke _activityACallBack.receivedData() in my
 service from within the worker thread that's waiting for tcp data I
 get my debug output above.  It's worth noting for clarification sake
 that the callback instance I pass in to my
 _service.registerActivityACallBack(..) method in my service is
 assigned to a global variable of type CallBackActivityAInterface
 within my service class.

 In activity B I have the same sort of implementation as you see above
 where I create it's own service connection instance and pass in a
 callback to the service so it can communicate with activity B.  When I
 navigate to activity B from activity A, I first unbind my service
 connection from the running service in activity A and then use the
 bindService method in activity B with it's own service connection.
 The issue I'm having is the callback instance I'm sending through to
 the service in activity B's onServiceConnected method is null when I
 try use it from within the worker thread that is currently running in
 the service.  This is the callback implementation I have in activity
 B:

 private CallBackActivityBInterface _service = null;

 private ServiceConnection serviceConnection = new ServiceConnection()
 {
    public void onServiceConnected(ComponentName className, IBinder
 binder) {
         _service = (CallBackActivityBInterface)binder;

        _service.registerActivityBCallBack(activityBCallBack);
    }

    public void onServiceDisconnected(ComponentName className) {
         _service = null;
    }
 }

 private CallBackActivityBInterface activityBCallBack = new
 CallBackActivityBInterface() {
    @Override
                public void receivedDataInActivityB() {
                        runOnUiThread(new Runnable() {

                                @Override
                                public void run() {
                                        Log.d(DEBUG, hoorah we have a 
 response in activity B);
                                }
                        });
                }
 };

 Stepping through the code reveals that activityBCallBack is not null
 when I inspect it within _service.registerActivityBCallBack(..),
 however the global variable I assign activityBCallBack to in my
 _service.registerActivityBCallBack(..) method is null when I try use
 it from within my worker thread that is already running.  Any idea why
 this would be null?

 I suspect it may be null because the worker thread is started before
 activity B has a 

[android-developers] Re: display homescreen after kill all the background process

2012-04-19 Thread Chris Stratton
On Thursday, April 19, 2012 1:07:22 PM UTC-4, Android Developer wrote:

 Hi All
  
 Can we able to display homescreen after kill all the background process.
  
 android.os.Process.killProcess(android.os.Process.myPid());


Try doing it in the other order - send the intent for the home screen and 
then die.  

You do realize android apps shouldn't normally kill their process, right 
(though there are situations _during development_ when that or exiting 
might be efficient)



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

Re: [android-developers] Re: bitmap.recycle() and multiple passes through a method question

2012-04-19 Thread Streets Of Boston
 *Now, here's the question:  if I return to this method, and re-use the
locally-created bitmaps that are local to that method, is that considered
re-using a bitmap that's already been recycled?  Or is that a fresh chunk
of memory?* 

I don't quite understand it. If you create a bitmap local to a method, I 
assume that you mean that you create a bitmap that can only be referenced 
within that method:

public void someMethod() {
  Bitmap localBitmap = BitmapFactory.decode.;
  ...
}

When you exit the method and you haven't assigned the reference of 
localBitmap to any other variable, then the Bitmap that is referred will be 
cleaned up by the garbage collector: The garbage collector will, at some 
point in time after you have returned from 'sometMethod', call the 
localBitmap.finalize() method. The finalize() method is implemented to call 
'recycle()'.

When you 'return' to someMethod(), I assume you mean you'll call 
someMethod()  again. If this is the case, then you'll create a brand-new 
Bitmap that will be assigned to localBitmap.

If you want the Bitmap, that is assigned to localBitmap, to survive after 
your code returns from someMethod, then you either need to assign 
localBitmap to a field (instance field or class field) or you need to 
return localBitmap as the return-value of someMethod(). 



On Thursday, April 19, 2012 9:49:23 AM UTC-4, Spooky wrote:

 On Thu, Apr 19, 2012 at 06:32:15AM -0700, Streets Of Boston wrote:
  After you call bitmap.recycle(), you can no longer use that bitmap at 
 all. 
  After calling recycle(), the bitmap still occupies a tiny little bit of 
  memory in the DalvikVM. All its raw pixel data memory has been released, 
  though. To release that tiny little bit of memory in the DalvikVM as 
 well, 
  release the reference to the bitmap (e.g. by doing 'bitmap = null' or by 
  just exiting the Java-block that contains 'bitmap' as a local variable) 
 and 
  the garbage collector will clean it up later.

 Now, here's the question:  if I return to this method, and re-use the
 locally-created bitmaps that are local to that method, is that considered
 re-using a bitmap that's already been recycled?  Or is that a fresh chunk
 of memory?

  When you don't call 'recycle()', the garbage collector will call 
  'recycle()' when the bitmap is garbage collected (through the bitmap's 
  finalize() method). But since you can't control the garbage collector 
  consistently across all types of devices/implementations, calling 
  'recycle()' yourself will make sure that the raw pixel data is released 
 at 
  your convenience. 

 That definitely matches my understanding.  Cool.

 Thanks,
--jim

 -- 
 THE SCORE:  ME:  2  CANCER:  0
 73 DE N5IAL (/4)| DMR: So fsck was originally called
 spooky1...@gmail.com|  something else.
  Running FreeBSD 7.0  | Q:   What was it called?
 ICBM / Hurricane:   | DMR: Well, the second letter was different.
30.44406N 86.59909W  |-- Dennis M. Ritchie, Usenix, June 1998.

 Android Apps Listing at http://www.jstrack.org/barcodes.html



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

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-19 Thread Streets Of Boston
  *But there is one big question...why does recycling the bitmaps after
their last use still result in a force close, saying that I tried to use
them AFTER they were recycled?  *

We don't have enough of your code. But suppose you have this code executed:


Bitmap bitmap1 = new BitmapFactory.decode.();
...
...
Bitmap bitmap2 = bitmap1;
...
...
bitmap1.recycle();
...
...

bitmap2.getWidth(); // kaboom: You're using an already recycled bitmap.

In other words, you're assigning the same Bitmap instance to more than one 
variable or field and you are using one variable to recycle() the bitmap. 
If the code handling the other variables/fields doesn't know about the fact 
that recycle() already has been called, handling these other 
variables/fields may result in a force close (bitmap already recycled). You 
can call 'bitmap.isRecycled()' if  you don't keep track of it yourself.



On Thursday, April 19, 2012 9:38:28 AM UTC-4, Spooky wrote:

 On Thu, Apr 19, 2012 at 06:25:12AM -0700, Streets Of Boston wrote:
  First, ignore this sentence below from my previous answer entirely:
   Save the byte[] data from the camera into file directly (this is your 
  JPG file).
  (It was a left-over chunk of my initial answer)

 Ah, that explains it.  :-)

  The 'byte[] data' still takes up memory, because the caller (the Android 
  SDK code that calls the onPictureTaken) still has hold of this 
 byte-array. 
  Setting data=null won't free that memory because only your code release 
  reference to it, not the caller's code.

 Ohhh, yeah, I hadn't thought about that.  Damn.  Not much I can do about
 that, then.

  You can save the raw data of the camera's Bitmap (the bitmap returned 
 from 
  decodeByteArray) by calling Bitmap.getPixels a few times (saving the raw 
  data in chunks)  or by calling Bitmap.copyPixelsToBuffer.

 That's basically what I came up with.  This basically just flashed across
 my brain this morning, and is a combination of ideas I'd been looking at.
 It goes something like this:

 1) if the device can handle this much, convert the original byte[]
array to a bitmap (easy).  if not, re-size, notify the user, and
deal with it.

 2) assuming we got past #1, split the file into vertical chunks using

Bitmap chunk1; // so each can be recycled immediately after use
Bitmap chunk2;

Bitmap chunkn;

chunk1 = createBitmap(src, 0, 0, width, height/n);

// save the chunk to a raw data file here

chunk1.recycle(); chunk1 = null;

and so on for all n chunks.

 3) recycle the original photo image;

 4) create the bitmap for the filter and repeat step 2 for it.

 5) re-use the bitmap from 4 (or recycle it and make another new one)
for the combined image, then, one at a time, recover the saved
bitmap chunks and use paint/canvas to re-build them, and then
immediately recycle the chunk once it's no longer needed.

 6) Save the new photo

 But there is one big question...why does recycling the bitmaps after
 their last use still result in a force close, saying that I tried to use
 them AFTER they were recycled?

 Oh, and steps 5 and 6 may need to be done in a new process, if I can
 figure out how to do that (or if someone here will point me to the
 appropriate reference in the dev guide).

 So, how does that sound?

 Thanks,
--jim

 -- 
 THE SCORE:  ME:  2  CANCER:  0
 73 DE N5IAL (/4)| Tux (E Cat):  DS B+Wd Y 6 Y L+++ W+ C++/C++ I+++
 spooky1...@gmail.com| T++ A E H+ S V- F++ Q+++ P/P+ B++ PA+ PL SC---
  Running FreeBSD 7.0  | 
 ICBM / Hurricane:   | Tiggerbelle:  DS W+S+Bts % 1.5 X L W C+++/C+
30.44406N 86.59909W  | I+++  T A E++ H S++ V+++ Q+++ P  B++ PA++ PL+ SC

 Android Apps Listing at http://www.jstrack.org/barcodes.html



-- 
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: LocationListener Network provider not called

2012-04-19 Thread lbendlin
I think Google are just too ashamed about the accuracy of the location 
returned by a cellular power sectoring (worst case) or triangulation (best 
case).  Loosen your accuracy requirements.

On Thursday, April 19, 2012 8:48:04 AM UTC-4, Fina Perez wrote:

 Hi all, 

 I'm facing a really annoying problem. In some point of the program, I 
 need to track the user position. For that I register a listener for 
 all the providers available and request updates. This was working 
 really good until I updated my phone to Android 4.0. But the same code 
 is working perfectly in older versions. 

 Now, the listener is not being called. But only under some conditions: 

 - if i have gps coordinates, this works perfectly ok, even if the gps 
 coordinates are lost, I get also network 
 - but if there is no gps coordinates and there is no wifi signal (but 
 the wifi on the phone is enable), I should be able to get the 
 coordinates using the 3g. Here is were it's not working. If I debug, I 
 can see how the listener is being registered but it is never called. 

 Please, help

-- 
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: Hidden fragments (and animations) after a rotation

2012-04-19 Thread lbendlin
Rotating the screen restarts the activity unless you explicitly tell the OS 
not to do that.

On Thursday, April 19, 2012 7:38:52 AM UTC-4, BoD wrote:

 Hi!

 I have an activity with a fragment that I hide in a transaction with a 
 custom animation.
 This transaction is added to the back stack.
 If I don't rotate the screen this is working as expected (pressing 
 'back' un-hides the fragment with the animation)

 1/ If I rotate the screen, the fragment is no longer hidden.  I 
 discovered that if I call setRetainInstance(true) on the fragment 
 however, this problem disappears.  But is this expected and/or 
 documented somewhere?

 2/ But even if I do that, pressing 'back' shout un-hide the fragment, 
 with the custom animation.  However:
   - Not using the support package, on a 3.2 Xoom, the fragment stays 
 hidden.
   - Using the support package, the fragment does become visible again, 
 but with no animation.
 Is this a (known) bug or did I miss something?

 Thanks a lot for your help!

 Here is the simple example demonstrating this (replace FragmentActivity 
 by Activity and comment/uncomment to switch from using the support 
 package or not):

 public class MainActivity extends FragmentActivity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  if (savedInstanceState == null) {
  final TestFragment testFragment = new TestFragment();
  testFragment.setRetainInstance(true);

  final FragmentTransaction ftAdd = 
 getSupportFragmentManager().beginTransaction();
  // final FragmentTransaction ftAdd = 
 getFragmentManager().beginTransaction();
  ftAdd.add(R.id.container, testFragment);
  ftAdd.addToBackStack(null);
  ftAdd.commit();

  final FragmentTransaction ftHide = 
 getSupportFragmentManager().beginTransaction();
  // final FragmentTransaction ftHide = 
 getFragmentManager().beginTransaction();
  // ftHide.setCustomAnimations(android.R.animator.fade_in, 
 android.R.animator.fade_out, android.R.animator.fade_in, 
 android.R.animator.fade_out);
  ftHide.setCustomAnimations(android.R.anim.fade_in, 
 android.R.anim.fade_out, android.R.anim.fade_in, android.R.anim.fade_out);
  ftHide.hide(testFragment);
  ftHide.addToBackStack(null);
  ftHide.commit();
  }
  }

  public static class TestFragment extends Fragment {
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup 
 container, Bundle savedInstanceState) {
  final TextView res = new TextView(getActivity());
  res.setText(Fragment);
  return res;
  }
  }
 }

 -- 
 BoD



-- 
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] SyncAdapter for an app that doesn't require authentication

2012-04-19 Thread Juliano Nunes
Hi,

I need a way to keep data updated on my app. I read about SyncAdapter and 
saw that it requires an AbstractAccountAuthenticator, but my app doesn't 
require the user to fill any user/password information. How can I deal with 
this?


Best regards,

Juliano Nunes

-- 
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 can I implement AB repeat function using mediaplayer

2012-04-19 Thread SH
Thanks, Chris.

After researching, I implemented the function by myself using tracking
the repeat mode.

Thread repeatThread = new Thread(){
public void run(){
   while (mediaPlayer!=null) {
if (isRepeatMode() 
mediaPlayer.getCurrentPosition()=toPoint) {
  mediaPlayer.seekTo(fromPoint);
}

//Code delaying 1second here...

   }
}
}

I started this thread just after the mediaplayer prepared in the event
listener. I think that there is better way to do that, but it works
well.

On Apr 20, 5:05 am, Chris Stratton cs07...@gmail.com wrote:
 On Wednesday, April 18, 2012 10:46:21 PM UTC-4, SH wrote:

  Hi all.

  I try to develop an audio player and would like to have A-B repeat
  function. When a user click A button while playing, it memorise
  starting position and clicking B button, it will save ending position.
  So it repeat A to B points until the user clear repeat position.
  It is easy to go back to the starting position B but not easy for
  endping position B because there is not listener to track when it
  arrived to the marked point.
  I look forward to your idea.
  Thanks in advance.

 It's been a couple months since I was working on something similar, but
 your options would likely be something along the lines of either
 piggybacking off of the progress bar updates (if possible) or using a
 thread to poll the position of the player.  When either of those methods
 indicates you are at or past your end point, seek to the desired start
 point again.

 Unfortunately, I'm not aware of a play until interface.

-- 
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: Need example on how to use MonkeyRunner from java

2012-04-19 Thread joebowbeer
A similar question was discussed here last year:

https://groups.google.com/d/topic/android-developers/rwXy22QBxOs/discussion

Also see the more recent blog post by Diego Torres Milano:

http://dtmilano.blogspot.com/2012/02/monkeyrunner-interacting-with-views.html


On Wednesday, April 18, 2012 3:26:50 PM UTC-7, gaurav wrote:

 Please let me know, if you have found the 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 there any alter native to download internal source code I am need mms source code ..

2012-04-19 Thread joebowbeer
http://androidxref.com/source/xref/packages/apps/Mms/ ?

On Friday, April 13, 2012 3:44:47 AM UTC-7, ADB wrote:

 Hi every one..

 Thanks to be here. I am developing MMS application i know there is 
 no official documentation available.but my problem is how can i download 
 internal application of android MMS application so that i can consider as 
 reference..
 I have Link http://code.google.com/p/modified-android-mms/source/checkout
 ..
 Please help any one 
 Thank you


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

Re: [android-developers] need help working with very large (photo) bitmaps

2012-04-19 Thread Jim Graham
On Thu, Apr 19, 2012 at 03:22:39PM -0700, Streets Of Boston wrote:
   *But there is one big question...why does recycling the bitmaps after
 their last use still result in a force close, saying that I tried to use
 them AFTER they were recycled?  *
 
 We don't have enough of your code. But suppose you have this code executed:

Ok, here's the actual code for the exact part that WAS causing the problem:

   public Bitmap mergeBitmaps(Bitmap src, Bitmap dest, int width, int height) {

  Bitmap bmp1 = Bitmap.createScaledBitmap(src, width, height, false);
  src.recycle() ; src = null;

  Bitmap bmp2 = Bitmap.createScaledBitmap(dest, width, height, false);
  dest.recycle() ; dest = null;

And then bmp1 and bmp2 were used from that point on.  Note that this code
has now been deleted.  I use src and dest directly.  I was originally
doing resizing at the end here, but that went away, and this code was
removed (well, the bmp1 and bmp2 parts, and the two recycle()s).

After that, the question was more just to learn why it didn't work as I
thought it would.  Now, I think I understand.  By using bmp1 and bmp2, I
WAS still using src and dest, even though they'd been recycled ... BAM!
FORCE CLOSE.

And thank you for explaning that to me.  I always thought that creating a
bitmap from another one was creating an entirely new bitmap, not still
using the old one.  Now I know what not to do.  :-)

Btw, just FYI, on an old (for this thread) topic:  out of curiosity, I
re-read RGB_565 to find out how many thousands of colors it had, and if
I might want to go ahead and consider it after all.  Then I read this
(in Bitmap.Config):

  This configuration may be useful when using opaque
  bitmaps that do not require high color fidelity.

There's no way this fits into a camera app primarily geared for serious
photography, looking at adding diffusion filters to soften faces, fog
filters (you can do a LOT with a low fog, moderately deep blue filter,
and the right scene/environment), and so on.  Think of it like going to
any of the planet's beautifyl natural wonders, with a camera.  Which
would you rather have (and this is based on film):  a point and shoot
35mm with the cheapest and crappiest film you could buy, or a Nikon F4
35mm with Kodak Ektar Professional 100 ASA film?  Yeah  :-)   I
thought of that comparison a few hours ago, and it fits, even though it's
film, not digital[1].

Thanks,
   --jim


[1] OT:  I still prefer film for some photography, at least, until I
have the money to get the latest---whatever is the latest at that
time---Nikon professional-class DSLR.  And maybe still even then,
unless, by that time, digital has more density and color depth
than pro-quality film like Ektar Pro, which can literally be enlarged
to WALL sized without a hint of grainyness (pixelation for digital).
In fact, even its old non-pro predecessor, Ektar 125, which I
discovered around 1990 or so, could be.  I saw it first-hand, and it
was incredible (and it was a BIG wall).  But that is WAY off-topic,
so I'll end this bit here.

-- 
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)| Peter da Silva:  No, try rm -rf /
spooky1...@gmail.com| Dave Aronson:As your life flashes before
 Running FreeBSD 7.0  |  your eyes, in the unit of time known as an
ICBM / Hurricane:   |  ohnosecond (alt.sysadmin.recovery)
   30.44406N 86.59909W  |

Android Apps Listing at http://www.jstrack.org/barcodes.html

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


Re: [android-developers] Re: bitmap.recycle() and multiple passes through a method question

2012-04-19 Thread Jim Graham
On Thu, Apr 19, 2012 at 03:15:23PM -0700, Streets Of Boston wrote:

 I don't quite understand it. If you create a bitmap local to a method, I 
 assume that you mean that you create a bitmap that can only be referenced 
 within that method:

No worries.  This was before I read your explanation (that I just
commented on and thanked you for).  I understand now.  :-)

Thanks,
   --jim

-- 
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)| Peter da Silva:  No, try rm -rf /
spooky1...@gmail.com| Dave Aronson:As your life flashes before
 Running FreeBSD 7.0  |  your eyes, in the unit of time known as an
ICBM / Hurricane:   |  ohnosecond (alt.sysadmin.recovery)
   30.44406N 86.59909W  |

Android Apps Listing at http://www.jstrack.org/barcodes.html

-- 
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: PendingIntent getService

2012-04-19 Thread ndiiie90
thx for reply Mark, however, we can still finish it manually by
calling stopSelf() method in the service

On Apr 18, 7:52 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Tue, Apr 17, 2012 at 10:13 PM, ndiiie90 rnd...@gmail.com wrote:
  so did you mean that I don't need to stop it because you said that
  which automatically shuts down when it is done processing the
  delivered command ?

 IntentService automatically stops itself once onHandleIntent() ends
 (assuming no further commands were sent to it during onHandleIntent()
 processing).

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

 Android App Developer Books:http://commonsware.com/books

-- 
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] I need to send smileys via mail

2012-04-19 Thread Febi.M.Felix Maliakkal
Hi,

If my url is www.example.com/sender=21receiver=34msg=smiley to insert

then, how can i send smiley to the particular receiver using this url???

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