[android-developers] Re: I want to develop browser app but i am getting errors help me please

2016-09-26 Thread Doug Carey
Hi David,

i am also facing this problem and If you still search to solve this problem 
please please contact pankaj to solve this problem email id : 
pankaj[dot]s[at]shaligraminfotech[dot]com


On Friday, September 23, 2016 at 12:08:34 PM UTC+5:30, David Miller wrote:
>
> Hi I am new to android i want to develop a browser app now I am trying to 
> develop it in this i am getting errors.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/c4242f0b-fceb-4668-b5e1-92c71db037c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: BLE Data Transfer Question

2016-03-19 Thread 'Doug Stevenson' via Android Developers
BLE is designed for broadcasting tiny amounts of data in packets (20 
bytes).  That would be entirely inefficient for larger amounts of data. 
 There is no reliable data streaming mode for BLE. These little chunks of 
data broadcast periodically are what make it "low energy".

The typical use case for BLE is with a beacon that repeatedly broadcasts 
information some state or information about itself to any other device that 
wants to listen.

On Friday, March 18, 2016 at 8:19:03 AM UTC-7, Adam Rogowicz wrote:
>
> If I am using BLE to transfer data, say updating firmware on a peripheral 
> device, what should I expect in the following situations?  Will the 
> transmission be interrupted, aborted, paused, etc.
>
>
>1. If the user receives a phone call
>2. If the user's device times out to the lock screen (auto lock)
>3. If the user gets a text message
>4. if the user connects a bluetooth headset
>
>
> I'm looking for a very quick response if at all possible, if you can 
> answer part of my question or all of it, please chime in.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/1ce7c47f-fdb1-492e-8620-e8a286ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Difference between swiping in all apps menu and pressing back to exit

2016-01-04 Thread Doug
The service IS the app.  There is no service without an app process to host 
it.  When your app process is killed (and you can never prevent that from 
happening) the service and all other app components will go with it.  
Anything else would be impossible for Android to manage since it chooses 
not to support the idea of a user knowingly closing an app like users 
expect on desktop operating systems.

On Sunday, January 3, 2016 at 9:12:15 AM UTC-8, Nick Teo wrote:
>
> Ah yes you're totally right. I started it sticky and that's why it's 
> coming back to life. Is there a way to keep the service running after the 
> app itself is killed? If not I guess I'll have to store the list in 
> persistent memory and load it in when the service starts. 

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/6d5e73a2-b04b-47e3-a6dd-2ae20f47efe5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Difference between swiping in all apps menu and pressing back to exit

2016-01-02 Thread Doug
Dismissing an app in the task switcher is the same as killing it.  If your 
service comes back after that, then something started the process again.  
Maybe your service is "sticky" and got restarted.  There is no guarantee 
your app's process can survive anything, so you should persist any changes 
that you do not want to be potentially lost.

Doug

On Wednesday, December 30, 2015 at 7:29:43 PM UTC-8, Nick Teo wrote:
>
> Hi all,
>
> I'm working on a messaging app that starts a service in the background 
> that will receive messages from a Pebble smartwatch and then send out an 
> sms message. Right at this moment, I'm trying to make it so that the 
> service is always running in the background so that the user can always 
> send texts even if the app isn't actually open. There is a private local 
> variable in the service that contains the contacts that the user can send 
> texts to. When I press the back button to exit the app after setting the 
> contacts, the list persists and when I open the app again, I see the 
> contacts. If I open up the all apps menu thing and swipe the app to exit 
> it, the list is destroyed, however, I know the service is still running (I 
> get Toasts from the service). I was under the impression that swiping the 
> app closed and pressing the back button are the same. Are they not? Is 
> there a way to make it so that the local variable is never destroyed as 
> long as the service is running?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/018f21c0-cdd0-4b30-a131-c3069c81e3b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] How to send reference object to a fragment in android studio

2015-12-04 Thread Doug


On Thursday, December 3, 2015 at 8:03:24 PM UTC-8, TreKing wrote:
>
>
> On Thu, Nov 26, 2015 at 12:35 AM, Vinayak Mestri <mestri.v...@gmail.com 
> > wrote:
>
>> I want to do like above code i.e student is reference variable so if i 
>> change any values of student arraylist will reflect to actual object in 
>> activity
>
>
> 1 - Look at the documentation for Fragment which shows the static 
> constructor pattern that is typically used to construct a fragment with 
> parameters.
> http://developer.android.com/reference/android/app/Fragment.html
> Your model object would implement the Parcelable interface to be passed 
> along as data.
>
> 2 - You can then let the Activity know when changes are made via callbacks:
>
> http://developer.android.com/guide/components/fragments.html#CommunicatingWithActivity
>
> You generally don't want the exact same data object in the activity and 
> fragment.
>

You generally *do* want the exact same data object if the object is large 
and would take significant time and memory to serialize and deserialize in 
a fully duplicated form.  This is especially OK if your source object is 
immutable and therefore threadsafe and immune to tampering for read 
operations.
 

> If you really really do, you could alternative expose it as a public 
> method in the Activity then instead of passing it to the fragment, access 
> your activity in the fragment (onAttach or onActivityCreated or something) 
> and get the list data, which would be the actual list both objects would 
> share.
>

Also, if serialization is not a well-performing option, sending the 
fragment an indicator on how to find the collection would be fine.  
Sometimes people use an event bus to publish stored data object to 
dependents.  Sometimes receiving from a singleton is good enough as long as 
it's not adding too much weight to the app.  Sometimes querying a content 
provider (backed by sqlite database) for very large collections is 
appropriate.

Doug

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/a903fbfa-9b30-4941-a94f-4831c310686c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Is runOnUiThread() ever 'safe' to call? If not why is it not deprecated?

2015-06-23 Thread Doug
There's a difference between promoting and showing a simple, terse 
example.  This I think is the latter.  I'm pretty sure if you ask any of 
the on-staff developer advocates if you should be writing 
production-quality code like this, they will probably say no, using a 
better mechanism.  But this is short and to the point.  The best 
production-worthy example would, unfortunately, take at least twice as many 
lines of code.

Also, this particular BT API is deprecated.

Doug

On Sunday, June 21, 2015 at 7:40:10 AM UTC-7, RLScott wrote:

 Google is still promoting runOnUiThread in their sample Bluetooth Low 
 Energy device scan callback code:

 private BluetoothAdapter.LeScanCallback mLeScanCallback =
 new BluetoothAdapter.LeScanCallback() {
 @Override
 public void onLeScan(final BluetoothDevice device, int rssi,
 byte[] scanRecord) {
 runOnUiThread(new Runnable() {
@Override
public void run() {
mLeDeviceListAdapter.addDevice(device);
mLeDeviceListAdapter.notifyDataSetChanged();
}
});
}
 };

 -Robert Scott
 Hopkins, MN



 On Tuesday, June 9, 2015 at 12:39:13 PM UTC-6, Sam Duke wrote:

 Due to the nature of config changes, the runnable submitted to 
 runOnUiThread may be executed after an activity has been destroyed (i.e. on 
 a stale activity). Therefore this API can cause all sorts of subtle bugs 
 with config changes and events never reaching the UI. I can't think of a 
 single case where it would be safe to use this. You should already have hit 
 the main thread by the time you are doing anything inside the runnable... I 
 think all it does is encourage poor patterns...

 Given this, is it not time to deprecate this API?




-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Is runOnUiThread() ever 'safe' to call? If not why is it not deprecated?

2015-06-13 Thread Doug
To be fair, no one should be taking any advice about Android programming 
from a 6 year old blog!

Just don't use unOnUiThread if it doesn't suit the situation.  I have no 
explanation why it's not fully deprecated, but the fact is that there are 
so many other recent techniques for managing background work.  I teach them 
in my class at AnDevCon, and they have better support on the official 
Android documentation and tutorials.

Doug

On Wednesday, June 10, 2015 at 5:59:39 AM UTC-7, Sam Duke wrote:

 I agree. The method has no real business being on an activity though 
 right? It only promotes bad code.

 How would you end up on a background thread on an activity? Perhaps you 
 are using your activity to ferry calls from model object A to model object 
 B and object B requires you to be on the main thread. Wouldn't you be 
 better gluing them together with another component. I would assert this is 
 a rare case and runOnUiThread is a convenience method for this case, but 
 how convenient is it really compared to the inconvenient mistakes it causes 
 people to make.

 At the very least, why is it not a method on Context? I would say its 
 presence on Activity does imply it is intended for making changes to views. 
 In fact, here's a blog from 2009 telling you to do just that: 
 http://android-developers.blogspot.co.uk/2009/05/painless-threading.html


 On Wednesday, 10 June 2015 08:24:27 UTC+1, Doug wrote:

 Calling runOnUiThread doesn't necessarily imply that you need to make 
 changes to an activity or its views.  If you just need to make sure some 
 code is executed on the main thread for whatever reason, then it's OK to 
 use this.  It's morally equivalent to scheduling a Runnable on a Handler 
 attached to the main thead, and there could be any number of reasons why 
 you need to use the main thread instead of another thread.

 However, if you do need to make changes to an activity or its views, this 
 is not the best method to call.  There are other mechanisms like Loaders 
 that are probably better solutions for the particular problem.

 If you just need to schedule a unit of work to run on the main thread 
 without respect to any activity or view, I think this should be seen as a 
 reasonable convenience to do so.  It's just too bad that runOnUiThread this 
 is a method on Activity because that could be misleading to the caller.

 Doug


 On Tuesday, June 9, 2015 at 11:39:13 AM UTC-7, Sam Duke wrote:

 Due to the nature of config changes, the runnable submitted to 
 runOnUiThread may be executed after an activity has been destroyed (i.e. on 
 a stale activity). Therefore this API can cause all sorts of subtle bugs 
 with config changes and events never reaching the UI. I can't think of a 
 single case where it would be safe to use this. You should already have hit 
 the main thread by the time you are doing anything inside the runnable... I 
 think all it does is encourage poor patterns...

 Given this, is it not time to deprecate this API?




-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Is runOnUiThread() ever 'safe' to call? If not why is it not deprecated?

2015-06-10 Thread Doug
Calling runOnUiThread doesn't necessarily imply that you need to make 
changes to an activity or its views.  If you just need to make sure some 
code is executed on the main thread for whatever reason, then it's OK to 
use this.  It's morally equivalent to scheduling a Runnable on a Handler 
attached to the main thead, and there could be any number of reasons why 
you need to use the main thread instead of another thread.

However, if you do need to make changes to an activity or its views, this 
is not the best method to call.  There are other mechanisms like Loaders 
that are probably better solutions for the particular problem.

If you just need to schedule a unit of work to run on the main thread 
without respect to any activity or view, I think this should be seen as a 
reasonable convenience to do so.  It's just too bad that runOnUiThread this 
is a method on Activity because that could be misleading to the caller.

Doug


On Tuesday, June 9, 2015 at 11:39:13 AM UTC-7, Sam Duke wrote:

 Due to the nature of config changes, the runnable submitted to 
 runOnUiThread may be executed after an activity has been destroyed (i.e. on 
 a stale activity). Therefore this API can cause all sorts of subtle bugs 
 with config changes and events never reaching the UI. I can't think of a 
 single case where it would be safe to use this. You should already have hit 
 the main thread by the time you are doing anything inside the runnable... I 
 think all it does is encourage poor patterns...

 Given this, is it not time to deprecate this API?




-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: where does Android Studio put the APK file?

2015-04-29 Thread Doug


On Tuesday, April 28, 2015 at 4:08:07 AM UTC-7, Spooky wrote:

 On Mon, Apr 27, 2015 at 11:42:12PM -0700, Doug wrote: 

  Since Studio just delegates to gradle for all of its build activity, you 
  too should just use the gradle command line if you want a particular 
 build 
  artifact. 

 Ok, I have no problem with the command line at all (prefer it, actually), 
 but what's the command?  Btw, I'm on a Mac (OS X Lion), if I didn't 
 mention that earlier. 


The assembleRelease and assembleDebug gradle targets will build an APK.

Your best bet is to take time to learn the build system since that is where 
all the tooling is headed in the future.  I'd start here:

http://tools.android.com/tech-docs/new-build-system/user-guide

The document is a bit outdated, but the concepts are valid.  There is a lot 
to know, but it is very powerful and I'm guessing there will be no 
substitute or alternative in the future.

Doug

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: where does Android Studio put the APK file?

2015-04-28 Thread Doug
It turns out that an Android Studio build just compiles the essential 
parts to verify that your project makes sense.  It doesn't produce an APK.  
You can see in the status bar what gradle tasks it's running at any moment. 
Studio will only produce an APK when you go to run it on a device.

Since Studio just delegates to gradle for all of its build activity, you 
too should just use the gradle command line if you want a particular build 
artifact.  After you run the assemble[Debug|Release] target, you can find 
the resulting APK by running the following command line on unix-y type 
machines:

find . -name \*.apk

where . is the location of the project root directory where you probably 
issued the gradle command.

Bottom line is that it's essential to learn the gradle way of doing things 
if you're going to be using Studio, since Studio builds all delegate to 
gradle.  This is a good thing -- your IDE should not be the thing 
responsible for producing your build artifacts.

Doug

On Monday, April 27, 2015 at 12:52:26 PM UTC-7, Spooky wrote:

 Ok, I give up  All of the posts (StackOverflow, etc.) I've found that 
 tell me where Android Studio puts the apk file after a Build Project or 
 rebuild project point me to directories that don't exist on my Mac. 

 Where, after a successful project build in Android Studio, do I find the 
 unsigned apk (in this case, listViewTest.apk) to load onto my various 
 Android devices (cp to ~/Dropbox and side-load from each)?  This is 
 driving me nuts.  It does build with no errors, and says the build 
 was completed.  But where is the apk file it generates?  One says it's 
 in app/build/outputs/apk/name.apk ... but app/build/outputs/apk doesn't 
 even exist, which makes it a bit difficult for the apk to be there. 

 Thanks, 
--jim 

 PS:  And I thought *EclipsE* was a major PITA (ok, it is, but). 

 -- 
 THE SCORE:  ME:  2  CANCER:  0 
 http://fineartamerica.com/profiles/4-james-graham.html 
 73 DE N5IAL (/4)  | AN EXCERCISE is a situation in which you stop 
 what 
 spook...@gmail.com javascript:  | you're doing in order to simulate 
 doing what you 
  Running Mac OS X Lion  | were doing so you can show someone else that 
 you 
 ICBM / Hurricane: | can simulate what you were doing as well as 
 you 
30.44406N 86.59909W| were doing it before you were interrupted. 



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] SQLite case insensitive matching

2015-04-18 Thread Doug Gordon
Similar questions have been asked, but many are old and it's not clear 
to me exactly what the resolution is. I have a list filter with a local 
db query that is matching columns against user input (uses MATCH, but 
that is probably not significant). Both the contents of the columns and 
the user input can be mixed case, but the match should be 
case-insensitive. This has been working (for years!) for most 
situations, but it was recently pointed out to me by a user (in France) 
that if he inputs a lowercase accented character, e.g. é, it will not 
match a database entry containing the uppercase equivalent, e.g. É.


My understanding is that Android SQLite does not support this 
automatically as it does for ASCII characters, but is there a solution 
within Android? I have no control over what is in the database (it comes 
from an outside source) or what the user inputs.


Doug Gordon
GHCS Software

--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Image is being oriented differently once uploaded to server, why?

2015-04-12 Thread Doug Gordon
I've seen this happen in a number of places when uploading images. The 
basic issue is that there are two ways to save a rotated image: save the 
raster data in the correct orientation and without metadata, or save the 
raster data in its native orientation and set the metadata value to 
indicate the desired rotation. The problem is that some software 
implementations still do not look at the metadata field and just display 
the raw raster image. So the photo may appear rotated correctly in one 
place and not rotated in another!


On Sunday, April 12, 2015 at 1:00:41 AM UTC-4, Dan Cha wrote:

 So within my app, i have the ability to allow the user to take a pic, see 
 a thumbnail within the app and once the form is submitted, its uploaded to 
 the server.

 But something ive noticed lately is that (since im storing the image taken 
 in the users gallery within a folder specific to the app) if you view the 
 pic outside the app in the actually folder, it looks oriented correctly, if 
 i take it portrait its portrait, if i take the pic landscape, its stored in 
 landscape.

 Also when the user is presented the thumbnail, it also shows correct, but 
 for some reason when the image is uploaded to the server, it no longer has 
 the correct orientation.

 Im using ftp to upload the image with this code:

 try
 {
 int reply;
 String reply2;
 ftpClient.connect(ftp.site.com);
 ftpClient.login(site,pass);
 ftpClient.changeWorkingDirectory(/imgs/);
 ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
 BufferedInputStream buffIn = null;
 buffIn = new BufferedInputStream(new 
 FileInputStream(file));
 ftpClient.enterLocalPassiveMode();
 ftpClient.storeFile(destinFolder,buffIn);
 buffIn.close();
 reply = ftpClient.getReplyCode();
 if(!FTPReply.isPositiveCompletion(reply))
 {
 ftpClient.disconnect();
 }
 ftpClient.logout();
 }

 I even changed my logic to this and still nothing, the image is always 
 uploaded in landscape. Even though the thumbnail and stored image on the 
 phone is portrait.
 Found at this link: 
 http://stackoverflow.com/questions/24629584/image-orientation-changes-while-uploading-image-to-server


   int rotate = 0;
 try {
 getContentResolver().notifyChange(imageUri, null);
 File imageFile = new File(al_image_paths.get(i)); 
 ExifInterface exif = new ExifInterface(
 imageFile.getAbsolutePath());
 int orientation = exif.getAttributeInt(
 ExifInterface.TAG_ORIENTATION,
 ExifInterface.ORIENTATION_NORMAL);

 switch (orientation) {
 case ExifInterface.ORIENTATION_ROTATE_270:
 rotate = 270;
 break;
 case ExifInterface.ORIENTATION_ROTATE_180:
 rotate = 180;
 break;
 case ExifInterface.ORIENTATION_ROTATE_90:
 rotate = 90;
 break;
 }
 Log.v(Common.TAG, Exif orientation:  + orientation);

 Bitmap rotattedBitmap= BitmapFactory.decodeFile(al_image_paths.get(i));   
 
 Matrix matrix = new Matrix();
 matrix.postRotate(rotate);
 return Bitmap.createBitmap(rotattedBitmap, 0, 0, 
 rotattedBitmap.getWidth(), rotattedBitmap.getHeight(), matrix,   true);
 } catch (Exception e) {
 e.printStackTrace();
 }



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Reusable code organization with Android Studio

2015-01-24 Thread Doug
You could use a local maven repo, then write yourself a convenience script 
that automatically builds and installs everything from wherever you like it 
to live.

Also, learn the semantics of what having -SNAPSHOT in a maven version 
string means for referencing build artifacts from a repo.

If you are the only one working on your app and all of its libraries, then 
just do whatever you want that's most convenient for you and don't worry 
about development conventions.  Just stick everything in one repo and take 
control of it yourself.  IMO conventions are mostly for teams that need to 
agree how collaborate well together.

Doug

On Friday, January 23, 2015 at 10:07:58 AM UTC-8, Nobu Games wrote:

 I set up a *Maven repository for my library modules* and add the needed 
 modules as dependencies to my app project

- Very elegant, but...
   - Every single tiny change in my library code requires rebuilding 
   and deploying the module.
   - I also fear that I need to increase the version code / build 
   number every single time so the local Maven cache gets updated? I have 
 no 
   experience with 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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] ViewPager pages not drawn

2014-12-20 Thread Doug Gordon
Kostya, I have done that and what I am seeing is the background of the 
ViewPager, but not my fragments' views. I set a breakpoint so I could go 
back into the ViewPager, and examining its data structure I find that not 
only does its mItems array contain my instantiated fragments, but also the 
mChildren array in the base View contains my fragments' expanded view 
hierarchies!

There is just something that is preventing the views from being drawn, even 
if I explicitly call invalidate() on the ViewPager. And it still seems that 
it must have something to do with using the support.v4 fragment support 
since it all works fine using native fragments.

On Friday, December 19, 2014 4:57:43 PM UTC-5, Kostya Vasilyev wrote:

 Have you tried debugging into ViewPager code?

 To see if your fragments' views are actually there and how they're laid 
 out?

 Another thing I often use in cases like this -- is to set the background 
 color of various views to distinct noticeable colors, like pink, cyan, etc. 
 In this case, I'd try the view pager itself, its parent view, and your 
 fragments' views.

 -- K

 2014-12-20 0:30 GMT+03:00 Doug Gordon gord...@gmail.com javascript::

 I haven't received any responses on stackoverflow about this, so am 
 giving it a shot here.

 My app, which is fairly large and complex (hard to post meaningful code) 
 uses as its main view a ViewPager with a FragmentPagerAdapter. Since the 
 minSDK is 14, I originally wrote it to use the native Fragment and related 
 classes (ViewPager from support.v4 and FragmentPagerAdapter from 
 support.v13). This has all been working perfectly for a long time.

 Recently I decided to build in more compatibility, mainly for themes, by 
 using the appcompat.v7 library. However, using this library required that I 
 use the Fragment and FragmentPagerAdapter, etc. classes from the support.v4 
 library (meaning that I also had to change my Activity to a 
 FragmentActivity, call getSupportFragmentManager, etc.).

 Making no more than these changes, my ViewPager comes up as a blank 
 screen; all I see is the ViewPager's background color; my fragments' views 
 are not displayed! What's really strange is that by putting in various 
 breakpoints, I can see that almost everything is working underneath as far 
 as my fragments' life-cycle methods being called, etc. I can swipe back and 
 forth across the screen and the fragments appear to be swapped in and out 
 as expected. It is particularly telling, however, that in various custom 
 views that I have, the onMeasure and onDraw methods are never called!

 Does anyone have any idea of what would be preventing the ViewPager from 
 actually drawing its views? If I revert the code to use the native fragment 
 support and associated supporting classes, everything shows up, which means 
 that if there is something wrong on my end it must be extremely subtle.

 (Just to throw in some confusion, there is another activity in the app 
 that also uses a ViewPager with fragments, and it continues to work with 
 either the native or support library classes. (I'm about to throw in the 
 towel and just forget this whole update.))

 Doug Gordon

 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@googlegroups.com 
 javascript:
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com javascript:
 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 unsubscribe from this group and stop receiving emails from it, send an 
 email to android-developers+unsubscr...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.




-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] ViewPager pages not drawn

2014-12-20 Thread Doug Gordon
SOLVED! After tracing the execution through ViewPager and 
FragmentPagerAdapter and trying to explain the very strange behavior I was 
seeing, I eventually discovered that when I wrote my fragments extending 
Fragment and ListFragment a long time ago, I had added a getView() method 
that was (inadvertently) overriding the method by that name in the 
superclass and was returning the wrong view for what the ViewPager was 
expecting. I removed these methods and everything started working.

The only explanation I have for why this code was working OK with the 
native fragments is that I noticed that the support.v4 fragments enclose 
the fragment's actual root view as returned by onCreateView with some sort 
of FrameLayout that they create, and that is what getView returns. The 
native fragments apparently do not do this, so the view returned by my 
getView method worked correctly.

The only odd thing, and I am not a Java expert, is that I did not precede 
my getView with @Override and did not notice any error or warning about 
that. Isn't this required? I know that when I wrote that code that I was 
not intending to override the superclass.

On Saturday, December 20, 2014 1:04:23 PM UTC-5, Kostya Vasilyev wrote:

 Ok, so the items are there and the views are there.

 What I would do at this point is check the attributes (data) of those 
 views:

 - Their positions and sizes
 - Visibility
 - Animation state
 - Translation / scaling
 - Scroll positions

 Or I would try to debug into the view pager's onMeasure / onLayout / 
 populate + scrollToItem

 For this second part, I would perhaps add a button in the layout that 
 calls requestLayout or setCurrentItem on the pager, to trigger as needed.

 -- K

 2014-12-20 17:17 GMT+03:00 Doug Gordon gord...@gmail.com javascript::

 Kostya, I have done that and what I am seeing is the background of the 
 ViewPager, but not my fragments' views. I set a breakpoint so I could go 
 back into the ViewPager, and examining its data structure I find that not 
 only does its mItems array contain my instantiated fragments, but also the 
 mChildren array in the base View contains my fragments' expanded view 
 hierarchies!

 There is just something that is preventing the views from being drawn, 
 even if I explicitly call invalidate() on the ViewPager. And it still seems 
 that it must have something to do with using the support.v4 fragment 
 support since it all works fine using native fragments.

 On Friday, December 19, 2014 4:57:43 PM UTC-5, Kostya Vasilyev wrote:

 Have you tried debugging into ViewPager code?

 To see if your fragments' views are actually there and how they're laid 
 out?

 Another thing I often use in cases like this -- is to set the background 
 color of various views to distinct noticeable colors, like pink, cyan, etc. 
 In this case, I'd try the view pager itself, its parent view, and your 
 fragments' views.

 -- K

 2014-12-20 0:30 GMT+03:00 Doug Gordon gord...@gmail.com:

 I haven't received any responses on stackoverflow about this, so am 
 giving it a shot here.

 My app, which is fairly large and complex (hard to post meaningful 
 code) uses as its main view a ViewPager with a FragmentPagerAdapter. Since 
 the minSDK is 14, I originally wrote it to use the native Fragment and 
 related classes (ViewPager from support.v4 and FragmentPagerAdapter from 
 support.v13). This has all been working perfectly for a long time.

 Recently I decided to build in more compatibility, mainly for themes, 
 by using the appcompat.v7 library. However, using this library required 
 that I use the Fragment and FragmentPagerAdapter, etc. classes from the 
 support.v4 library (meaning that I also had to change my Activity to a 
 FragmentActivity, call getSupportFragmentManager, etc.).




-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-14 Thread Doug
It's been a long time since I've been active on it, but I believe you can 
intercept everything that passes through a url, both what would be loaded 
by navigation, image, and ajax.  Give it a try and implement all the 
callbacks exposed by webview, log a simple message, and see how it goes.

Doug

On Saturday, December 13, 2014 1:53:56 PM UTC-8, Krystian Lewandowski wrote:

 Thank you for the idea. Though, I don't think it will work. What about 
 AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
 called for these.

 Krystian

 W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:

 You could use a WebViewClient to intercept everything a WebView is trying 
 to fetch and fetch it yourself using whatever API suits your needs.

 Doug

 On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski 
 wrote:

 Hi,
 I'm trying to update ConnectivityManager.requestRouteToHost 
 implementation from deprecated one to ConnectivityManager.requestNetwork 
 introduced in Lollipop. It supports Sockets, SocketFactories, 
 URLConnections - this is fine. The only thing missing at the moment is 
 WebView support. Application's requirement is to route WebView.loadUrl 
 requests via specific interface, but I can't see how it could be done with 
 the new API (I can't use setProcessDefaultNetwork).

 I looked at WebView API but couldn't find anything new that would 
 support changed routing API. Is it supported, am I missing something?

 Thank you,
 Krystian



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-14 Thread Doug
Did you actually try WebViewClient.shouldInterceptRequest?  I'm looking 
through old code of mine that suggests it will work.  Also, you should try 
searching for WebViewClient shouldInterceptRequest to see what places 
like StackOverflow say.

Doug

On Sunday, December 14, 2014 10:39:21 AM UTC-8, Krystian Lewandowski wrote:

 Hi Doug,
 I mean, I can get the page and there is onLoadResource I missed last time, 
 but another question is - even if I get a resource, how to inject it? 
 Callbacks, in this case, serve kind of notification purpose there is no way 
 to replace loaded resource (whatever it actually is) or inject custom 
 loader instead. At least at the moment I don't see a solution.

 Thank you for ideas,
 Krystian

 W dniu niedziela, 14 grudnia 2014 18:30:15 UTC+1 użytkownik Doug napisał:

 It's been a long time since I've been active on it, but I believe you can 
 intercept everything that passes through a url, both what would be loaded 
 by navigation, image, and ajax.  Give it a try and implement all the 
 callbacks exposed by webview, log a simple message, and see how it goes.

 Doug

 On Saturday, December 13, 2014 1:53:56 PM UTC-8, Krystian Lewandowski 
 wrote:

 Thank you for the idea. Though, I don't think it will work. What about 
 AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
 called for these.

 Krystian

 W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:

 You could use a WebViewClient to intercept everything a WebView is 
 trying to fetch and fetch it yourself using whatever API suits your needs.

 Doug

 On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski 
 wrote:

 Hi,
 I'm trying to update ConnectivityManager.requestRouteToHost 
 implementation from deprecated one to ConnectivityManager.requestNetwork 
 introduced in Lollipop. It supports Sockets, SocketFactories, 
 URLConnections - this is fine. The only thing missing at the moment is 
 WebView support. Application's requirement is to route WebView.loadUrl 
 requests via specific interface, but I can't see how it could be done 
 with 
 the new API (I can't use setProcessDefaultNetwork).

 I looked at WebView API but couldn't find anything new that would 
 support changed routing API. Is it supported, am I missing something?

 Thank you,
 Krystian



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-14 Thread Doug
OK, that's very different than what you first asked.

You will have to write shim to connect your app and the webview.  The page 
hosting the webview will have to provide a function to call that makes the 
necessary adjustments.  Then on the app side you call loadUrl with a 
javascript url to call that function with whatever parameters it needs.

Google android webview inject javascript for more details.  (Google 
answers most of your questions if you just ask it.)

Doug

On Sunday, December 14, 2014 1:45:46 PM UTC-8, Krystian Lewandowski wrote:

 Hi,
 the problem is that it is possible to get HTML skeleton (or whatever it 
 is, because we do not control remote side) via specific route with 
 additional implementation in shouldInterceptRequest. It is possible to 
 inject loaded the content via WebView.loadDataWithBaseURL, but that's it. 
 The question is how to inject additional resources to WebView?

 Thank you,
 Krystian

 W dniu niedziela, 14 grudnia 2014 22:33:36 UTC+1 użytkownik Doug napisał:

 Did you actually try WebViewClient.shouldInterceptRequest?  I'm looking 
 through old code of mine that suggests it will work.  Also, you should try 
 searching for WebViewClient shouldInterceptRequest to see what places 
 like StackOverflow say.

 Doug

 On Sunday, December 14, 2014 10:39:21 AM UTC-8, Krystian Lewandowski 
 wrote:

 Hi Doug,
 I mean, I can get the page and there is onLoadResource I missed last 
 time, but another question is - even if I get a resource, how to inject it? 
 Callbacks, in this case, serve kind of notification purpose there is no way 
 to replace loaded resource (whatever it actually is) or inject custom 
 loader instead. At least at the moment I don't see a solution.

 Thank you for ideas,
 Krystian

 W dniu niedziela, 14 grudnia 2014 18:30:15 UTC+1 użytkownik Doug napisał:

 It's been a long time since I've been active on it, but I believe you 
 can intercept everything that passes through a url, both what would be 
 loaded by navigation, image, and ajax.  Give it a try and implement all 
 the 
 callbacks exposed by webview, log a simple message, and see how it goes.

 Doug

 On Saturday, December 13, 2014 1:53:56 PM UTC-8, Krystian Lewandowski 
 wrote:

 Thank you for the idea. Though, I don't think it will work. What about 
 AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
 called for these.

 Krystian

 W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:

 You could use a WebViewClient to intercept everything a WebView is 
 trying to fetch and fetch it yourself using whatever API suits your 
 needs.

 Doug

 On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski 
 wrote:

 Hi,
 I'm trying to update ConnectivityManager.requestRouteToHost 
 implementation from deprecated one to 
 ConnectivityManager.requestNetwork 
 introduced in Lollipop. It supports Sockets, SocketFactories, 
 URLConnections - this is fine. The only thing missing at the moment is 
 WebView support. Application's requirement is to route WebView.loadUrl 
 requests via specific interface, but I can't see how it could be done 
 with 
 the new API (I can't use setProcessDefaultNetwork).

 I looked at WebView API but couldn't find anything new that would 
 support changed routing API. Is it supported, am I missing something?

 Thank you,
 Krystian



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-13 Thread Doug
You could use a WebViewClient to intercept everything a WebView is trying 
to fetch and fetch it yourself using whatever API suits your needs.

Doug

On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski wrote:

 Hi,
 I'm trying to update ConnectivityManager.requestRouteToHost implementation 
 from deprecated one to ConnectivityManager.requestNetwork introduced in 
 Lollipop. It supports Sockets, SocketFactories, URLConnections - this is 
 fine. The only thing missing at the moment is WebView support. 
 Application's requirement is to route WebView.loadUrl requests via specific 
 interface, but I can't see how it could be done with the new API (I can't 
 use setProcessDefaultNetwork).

 I looked at WebView API but couldn't find anything new that would support 
 changed routing API. Is it supported, am I missing something?

 Thank you,
 Krystian


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Can't update widget preview on Nexus 5/Lollipop

2014-12-01 Thread Doug Gordon
I am modifying a widget product, including an all-new screen layout. The 
development is going well and I'm about ready to release the update, but 
am having a very interesting anomaly on my Nexus 5 with the recent 
Lollipop upgrade. Basically, no matter what I do, the widget preview 
shown in the launcher's widget screen is the one from the previous 
version that was installed -- not the updated one in my widget. The old 
preview graphic does not exist anywhere in my project structure and I 
even gave the new preview a different name.


The really strange thing is that the old image persists even if I 
completely uninstall the widget from the Apps Manager, then reboot the 
phone and install the new version. Interestingly, when I press and hold 
the preview image and begin to drag it onto my home screen, the image 
changes to the new one as I drag it! Obviously, the launcher has the old 
image cached somewhere and does not clear it out when the widget is 
deleted and does not check to see if it has changed when installing the 
same widget again. The preview on the widget screen does update as 
expected on my other devices.


Anyone have any ideas? Is this a Lollipop bug?

  Doug Gordon
  GHCS

--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Simple PagerAdapter does not display views

2014-11-25 Thread Doug Gordon
Yes, and that's what's so frustrating, Kastya. The breakpoints appear to 
indicate that everything is working, as does the fact that it responds to a 
swipe. For example, if I start it off by calling ViewPager with 
setCurrentItem(3), my instantiateItem is called with position=3, followed 
by position==2 and 4 (the views to either side). When swiping to go to the 
right, destroyItem is called with position=2 and instantiateItem position=5 
as expected. isViewFromObject is called numerous times and I correctly 
return true or false. Since the data in the adapter never changes, 
getItemPosition always returns POSITION_UNCHANGED per the specs.

I feel like there is something I'm missing that is failing to make my views 
visible, or else there is some undocumented feature since they do not 
provide much info for using the base PagerAdapter (all the samples are 
using FragmentPagerAdapter or FragmentStatePagerAdapter. I am now 
considering changing over to use fragments instead of simple views since I 
know that works even though to me it seems less efficient in this case.

Thanks for your response in any case!

  -- Doug


On Monday, November 24, 2014 5:09:31 PM UTC-5, Kostya Vasilyev wrote:

 Did you properly implement the adapter's isViewFromObject?

 How about getItemPosition?

 -- K




-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Simple PagerAdapter does not display views

2014-11-24 Thread Doug Gordon
I have a fragment in which I want to display a number of similar pages 
using ViewPager. For some reason I thought that it would be simpler to 
extend the base PagerAdapter to feed views to the ViewPager. My custom 
PageAdapter implements instantiateItem by inflating a layout, populating 
its widgets, and then calling addView against the container view. The 
containing ViewPager is the view that I return from the onCreateView 
method of the fragment.


The problem is that this is working from a paging point of view, but the 
screen remains blank. By setting breakpoints, I find that when I swipe 
across the (blank) screen, my PagerAdapter is called as expected 
(instantiateView, destroyView, etc.) to return the next/previous view, 
but nothing is shown -- only the background of the ViewPager. Examining 
the ViewPager at the breakpoint, the expected instantiated views are in 
its array of child views.


Any clues on where to look? I've implemented a FragmentPagerAdapter 
elsewhere with no issues, but this does seem like it would be easier, 
especially since these views have no controls on them (just data).


Doug Gordon
GHCS Software

--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Creating a custom-view with rounded corners

2014-11-13 Thread Doug Gordon
I don't believe that would (or could) be possible. After all, the Android 
o/s doesn't understand the content of your background image. Those 
rounded corners just exist as pixels in an image and are not defined 
mathematically in any way so that the drawing software could clip to them. 
All that is understood by the system are the rectangular coordinate limits.

On Wednesday, November 12, 2014 5:54:02 PM UTC-5, dashman wrote:

 I've got a view that goes into a listview and would like each to have a 
 rounded corners.

 For the custom view layout, I set the parent to a RelativeLayout and
 and set the background to a shape - that sets rounded corners.

 RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android;
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:background=@drawable/bg
 
 
 But the problem is that if inside the view, if i draw to the edges - it 
 doesn't
 get clipped to the rounded corners.

 Any way to force that.




-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Android Studio Editor feature

2014-10-27 Thread Doug Gordon

  
  
After years of using Eclipse, I'm making the transition to Android
Studio and am still mystified by some of what I see. The latest
surprise was when I opened a source file to make an edit and saw
that I apparently had hard-coded a string even though I was sure
that I hadn't done so. IOW, what I saw was:

 Toast.makeText(mCtx, "Evernote app not found",
Toast.LENGTH_SHORT).show();

However, the text was lightly grayed and highlighted. When I clicked
inside the text, the line changed to what I had actually coded,

i.e.:

 Toast.makeText(mCtx, R.string.evernote_err,
Toast.LENGTH_SHORT).show();

Which was more like it! Although this feature is certainly very cool
in some circumstances, there are other times when I'd prefer to just
see what I typed. So what is this feature called? Can I switch it on
and off (once I had collapsed the string to the constant, I could
not get it to revert until I opened the file again)?

    -- 
Doug Gordon
GHCS Software
http://www.ghcssoftware.com
g...@ghcssoftware.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
--- 
You received this message because you are subscribed to the Google Groups Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Fragment animations using objectAnimator to slide over the previous fragment

2014-06-06 Thread Doug
I have not thought through this myself thoroughly, but have you considered 
using a FragmentPagerAdapter with a ViewPager?

Doug

On Thursday, June 5, 2014 11:41:02 AM UTC-7, Simon Giddings wrote:


 I have seen the kind of effect I want being demonstrated with the 
 ViewPager 
 http://developer.android.com/training/animation/screen-slide.html#depth-page
  
 - but I am using Fragments.
 Can this kind of transition (just the moving in from the left bit shown at 
 the end) be achieved with fragment animation ?


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Share Loader's data between multiple fragment

2014-06-04 Thread Doug
I would do #2, except don't use setArguments to pass the data in.  When the 
loader callbacks fire, just reach into each fragment instance directly and 
call a custom method to pass the model in.  You might have to check 
fragment class types and cast to implement this.  Personally I would make 
all the fragments implement an interface such as ModelReceiver which a 
method receiveModel(Model) so they can get the model object.

Doug

On Tuesday, June 3, 2014 3:53:41 PM UTC-7, Nathan Barraille wrote:

 Hello,
 I have a problem with the Android framework for which I'm not able to find 
 any ideal design solution.
 I have an activity that contains multiple fragments, all those fragments 
 need to access the same model object. This model object can be loaded from 
 a memory cache, ContentProvider or network, depending on a bunch of 
 parameters. I wanted to use a Loader to load that model object, so that it 
 doesn't have to be loaded again when the activity is recreated, and it can 
 be observed if it changes.
 All my fragments don't really have a purpose without the model object 
 loaded, as they don't have any data to display.
 Here are the options I considered:

 *#1: Have the activity initialize the loader in its onCreate() method, and 
 add the fragments to the activity when the model finishes loading: *
  *Problem:* It is unsafe to make fragment transactions in a callback 
 method, because the activity state might be paused, according to 
 http://developer.android.com/reference/android/app/LoaderManager.LoaderCallbacks.html#onLoadFinished(android.content.LoaderD,
  
 D)

 *#2: Have the activity initialize the loader and add the fragments in its 
 onCreate() method, and call a custom method on the fragment to set the 
 model*
  *Problem:* I cannot use the recommended setArguments() method to set 
 the data on the fragment, which means that if my fragment is re-created by 
 the system, it won't have a reference to the model anymore

 *#3: Have the activity initialize the loader and add the fragments in its 
 onCreate() method, and have the fragments access the model through the 
 activity*
 *Problem*: The fragments won't know whether or not the model is 
 loaded in the activity, and if I add a method on the fragment for the 
 activity to let it know, I'll have the same problem as #2

 *#4: Have all my fragments initialize a loader independently and load the 
 data on their own.*
  *Problem:* That's really inefficient, especially if the model needs 
 to be loaded from the network

 I'm kind of thinking now that I could do something like #3, and having an 
 additional call in my fragments' onResume() that checks whether or not the 
 model is set in the activity to set its state, but that seems hacky...

 Is there a cleaner way of doing this?

 Thanks!


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


[android-developers] Re: ListView getCount is wrong - how do I reset it?

2014-05-17 Thread Doug


On Friday, May 16, 2014 11:58:17 AM UTC-7, plnelson wrote:

 ...In MyListActivity, which is a ListActivity . . .

 public static ListView lv;   // my ListView in the code


Why is this public and static?
 

 ...the data source is an ArrayList called listItems. The first time around 
 it has 12 items in it; later I clear it and add in 6 items. (see below)

 public static ArrayListStringlistItems=new ArrayListString();


Why is this public and static?
 

 ... in my adapter, which is a BaseAdapter, my override of getCount() looks 
 like this. After shrinking listItems to 6 it correctly returns 6.

 @Override
 public int getCount() {
 return listItems.size();
 }

 ... To shrink my dataset to 6 I first do a

 listItems.clear();
 lv.invalidate();   // my (failed) attempt to get lv to reset its count


Invalidate doesn't do what you think it does.  That has to do with the 
rendering of the view on screen, not the contents of the adapter that the 
ListView knows about.
 

 ... and then add in the 6 new items. After adding each item to listItems I 
 do a notifyDataSetChanged() on the adapter. What I've noticed is that if* 
 I do an lv.getCount it returns 12, i.e., the value it was before doing the 
 listItems.clear()* and invalidate(). Why does the ListView still think 
 it's 12? How do I reset it? Is that why the adapter thinks it's too big?


Try setting a new (non-public, non-static) adapter into the ListView 
instead.

Never change the contents of the data in an adapter after you've given it 
to the ListView.  Make a deep copy of the data before sending it if you 
have to.

Doug

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Order of intents delivery

2014-05-16 Thread Doug
Yes, if they are called from the same thread because they will eventually 
be processed serially from the queue on the main thread's looper.

Doug

On Thursday, May 15, 2014 4:49:59 AM UTC-7, Durgadoss Ramanathan wrote:

 Hi,

 I have a Service from which I send an intent twice like below. I have only 
 one receiver  that receives and processes this intent.

 mContext.sendBroadcast(intent);
 ...Do some Ops...
 ...pack different data into intent...
 mContext.sendBroadcast(intent);

 Does android guarantee that the first intent sent is received first ?


 -- 
 Regards
 Durgadoss 


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Re: looking for HTML5 and javascript based sdk....

2014-05-12 Thread Doug
Please, just stop.  You are arguing with a fool!

On Sunday, May 11, 2014 10:30:22 PM UTC-7, Kristopher Micinski wrote:

 What are you even talking about: Any JavaScript program is also going 
 to have threads, too. 

 You seem to be making this argument: Java has multiple threads, and 
 that makes the programs slow. 

 It sounds like all of this is coming from a completely uneducated 
 viewpoint on systems design, but there are a number of 
 issues. 

 Please understand, however, that all of the issues in Java carry over 
 (and worse) to JavaScript, you still need multiple threads, you still 
 need a garbage collector. 

 Please also quit citing other Java products as evidence that it has 
 anything to do with Android.  Forget Java, android doesn't run Java. 
 Android runs Dalvik.  Which is completely different than Java.  You 
 can translate anything into Dalvik, people usually translate Java, 
 there's no reason you couldn't also translate anything else. 

 Kris 



 On Mon, May 12, 2014 at 1:22 AM, 李白|字一日 cali...@gmail.com javascript: 
 wrote: 
  the slow comes not just from the loading of java based apps. but the 
 java 
  itself and the bad programming guidance, which uses too many threads and 
  classes which take a lot space. and what even worse is you will 
 sometimes 
  have to do deep inheritance. 
  
  it adds extra overheads to make itself run. 
  these are ignored while benchmark. 
  
  i am by no means expert in languages. but it is true that java is slow 
 to 
  what ever products made by java. 
  
  eclipse, android, j2me, netbeans, idea. 
  none of them are famous for their speed and memory saving. 
  
  
  
  
  2014-05-12 11:22 GMT+08:00 bjv bjve...@gmail.com javascript:: 
  
  Ugh! You don't get it and likely never will. There are so many things 
  wrong with your assumptions/statements in all of these threads. It 
 really 
  isn't worth the time to debunk them all. 
  
  But for what its worth, there is small overhead with respect to running 
  Java/Dalvik on Android. That said, it is mostly upfront. JS is an 
  interpreted language. Outside of the various ASM-JS experiments, Your 
  html5+JS likely will always be interpreted. In a broad comparison, it 
 will 
  almost always be slower. Your thinking that you get to share all those 
 JS 
  object goodies between various apps/components is in itself a cause for 
  concern. 
  
  In an effort to remove the Dalvik overhead on Android, the Android guys 
  are now rolling out ART (a variant of llvm) that will transfer most of 
 that 
  overhead to installation time. At that point, Java isn't going to be 
 much 
  different than C++ from an execution perspective. 
  
  
  On Sunday, May 11, 2014 1:41:41 PM UTC-5, 李白,字一日 wrote: 
  
  if it is not, why should you go native with c/c++ based ndk 
 programming? 
  
  it is surely related to the programming language. 
  
  javascript 's speed acceleration is also related to the language and 
 its 
  optimization, which is almost always c/c++. 
  
  i have never experienced the fast feeling of java technology both in 
  desktop or server side. 
  
  i never experienced fast  feeling in android, eclipse, java ee, j2me. 
  am 
  i fooled? 
  
  eclipse is famous for it's slow and memory consuming, though it is the 
  greatest  ide i ever used. 
  
  javascript based ide, like local compiled c9.io is very fast and 
  responsive, thought it is not that mature. 
  
  why ? ? ? 
  
  and if android ui design can be written directly in html + css, it has 
  all the flexibility css and html have now. If you know the web 
 technologies, 
  you should know what i mean. 
  
  it is meaningless to discuss about the languages' performance, but the 
  trend is that javascript will play a more important role in server 
 side 
  programming, hardware based programming and browser side programming. 
  
  
  2014-05-12 1:03 GMT+08:00 Colin M colin...@gmail.com: 
  
  I'll ignore the unqualified claim that the slowness of Android is due 
 to 
  Java. 
  
  It sounds like your complaint is that you can't develop native apps 
 in 
  your preferred language and that you're using an outdated claim about 
 Java 
  to support your desire to change the current language of choice for 
 Android 
  development. 
  
  The XML based components can all be done via code.  Do you have an 
  example of how they are far from flexible?  There are many 
 limitations, 
  but you are welcome to write your own custom Views to get around any 
  limitations.  I have many of my own complaints about some of the UI 
 system, 
  but I have no reason to believe the current state of things would be 
 faster 
  or more flexible if it were in another language.  That's not the 
 thing 
  limiting flexibility or causing speed issues, that's more about the 
  implementations.  I've created and seen many fast and fluid and 
 complex UIs 
  on Android, but you sometimes have to do some real work to get them 
 and they 
  don't always drop right out of 

[android-developers] Re: Choreographer regularly skipping frames during OpenGL Render

2014-04-13 Thread Doug
Bear in mind that anything could be causing main thread delays.  It could 
be your code.  It could be other threads in your app's process.  It could 
be other apps running on the device.  It could be Android itself.  It could 
be any combination of these things.  This is to be expected with 
multitasking multiuser operating systems and the wide variety of devices 
out there and their hardware capabilities.

The Choreographer itself doesn't start complaining about skipped frames in 
logcat until after 30 frames have been skipped:

private static final int SKIPPED_FRAME_WARNING_LIMIT = 
SystemProperties.getInt(
debug.choreographer.skipwarning, 30);

So maybe you can lighten up your own acceptable threshold for frames 
skipped (unless you're actually observing the jank that you're trying to 
avoid)?

Doug

On Friday, April 11, 2014 10:37:39 AM UTC-7, Dave Smith wrote:

 Hello all -

 I am working on an application that is using Choreographer and OpenGL to 
 render flash patterns on the display.  Our GL calls are quite simple, 
 simply toggling the display back and forth between white and black using 
 glClearColor() based on the frame time and status of the pattern we want to 
 apply.  The timing of this pattern if very critical, and I am having severe 
 issues getting consistent behavior out of the timing pulses we received 
 from Choreographer to do the rendering.

 For simplicity sake, I have basically copied the Basic Dream application 
 in AOSP, so 95% of my code looks exactly like this sample:

 https://android.googlesource.com/platform/packages/screensavers/Basic/+/master

 Our only change is that, where they call mSquare.draw() inside of 
 doFrame(), we have another method called drawFrame() that does the 
 following:

 private void drawFrame() {
 final boolean nextBit = mPattern[mIndex];

 if (nextBit) {
 glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
 } else {
 glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
 }
 glClear(GL_COLOR_BUFFER_BIT);

 return true;
 }

 However, for the purposes of this discussion, you can see the *exact same 
 behavior* by simply running the AOSP sample as an application (i.e. 
 changing the Colors class from a DreamService to a launcher Activity).

 The problem is that on a regular basis (at least once per second, often 
 many times), the debug logging returns that the frame callback took 33ms 
 (instead of 16ms), and in many cases 50ms+!  I can understand skipping a 
 rare frame here or there, but skipping 3-4 frames at once seems like I'm 
 missing something big here.  Not all devices do this, but high-end devices 
 like the Nexus 5 and GS4 do.  Devices we've tested like the Note 3, GS3, 
 and Moto X don't seem to do so nearly as often.  Example typical logcat 
 over a period of 30 seconds:

 04-11 11:35:43.918  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (49865722 ms) frame 2
 04-11 11:35:43.948  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33264161 ms) frame 3
 04-11 11:35:43.988  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33233641 ms) frame 4
 04-11 11:35:44.018  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33233644 ms) frame 5
 04-11 11:35:45.860  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33264161 ms) frame 115
 04-11 11:35:46.881  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33233641 ms) frame 175
 04-11 11:35:47.692  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33233642 ms) frame 222
 04-11 11:35:48.242  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33264160 ms) frame 255
 04-11 11:35:49.373  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33233643 ms) frame 322
 04-11 11:35:53.908  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33268229 ms) frame 594
 04-11 11:35:56.190  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33264161 ms) frame 730
 04-11 11:35:56.690  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33233643 ms) frame 759
 04-11 11:35:57.751  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (49965416 ms) frame 821
 04-11 11:35:57.781  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33164467 ms) frame 822
 04-11 11:35:58.952  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33233643 ms) frame 891
 04-11 11:36:04.678  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33264161 ms) frame 1235
 04-11 11:36:05.919  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33264159 ms) frame 1308
 04-11 11:36:07.781  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (33298746 ms) frame 1419
 04-11 11:36:07.821  10441-10455/com.android.dreams.basicgl 
 V/ColorsGLRenderer﹕ JANK! (49800618 ms) frame 1420
 04-11 11:36:08.672

[android-developers] Re: Can't create handler inside thread that has not called Looper.prepare()

2014-03-28 Thread Doug


On Thursday, March 27, 2014 2:04:24 AM UTC-7, Yuvi wrote:

 You have to create your Handler in separate thread.


That's not really true.  You can use the Handler constructor that takes a 
Looper so that its work gets scheduled the thread represented by that 
Looper.  For example, you could create a Handler against the main thread's 
looper from any other thread like this:

new Handler(Looper.getMainLooper())

Now that handler will schedule work on the main thread.

Doug

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Image captured from my app is rotated by default

2014-03-25 Thread Doug Gordon
This may not be related to your problem, but I believe that there are 
basically two ways that the orientation of a JPEG photo is determined. One 
is simply by the way the actual data in the file is laid out; for example, 
whether it is stored as 1024x768 or 768x1024. The other determinate is an 
(optional) datum in the file's metadata that specifies camera 
orientation and indicates the degrees of rotation. So even if a photo's 
data is stored as 1024x768, if the orientation data is +90, then it is to 
be displayed rotated to the right in 768x1024 format.

The problem that I've found is that not all devices or image 
processing/display software seems to use the metadata and, making things 
worse, may not propagate the data when saving a modified image. So I've had 
photos from my phone that I've had to rotate in image software to make them 
look right on my PC, but then I'll do something like upload them to 
Facebook and they're rotated the wrong way!

I might be wrong about this, but it's what I've concluded after playing 
around with various devices and image processing programs.

On Tuesday, March 25, 2014 2:07:37 AM UTC-4, Jags wrote:

 Hi All,

 I tried to capture an image and send it to server in my app. I did that 
 using camera intent. the problem is in my samsung galaxy s4 device the 
 image is rotated -90 degree by default. I read around web that it is a 
 problem with the samsung devices. But what is the best solution to it ? if 
 i rotate the image after capture, it becomes heavy image processing in my 
 app. What is the best approach to resolve this ? 

 in phonegap there is something like correctOrientation = true / false 
 what's its counterpart in native code ?

 thanks and regards
 jags


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: ContentResolver obtaining java.io.File instead java.io.FileDescriptor

2014-03-09 Thread Doug
That's because a FileDescriptor doesn't necessarily reference an actual 
file on a filesystem.  It's an abstraction for a stream of bytes that could 
be coming from a file or some other source (such as stdin, stdout).  You're 
not supposed to know or care what it is, you just read or write it.

Doug

On Saturday, March 8, 2014 4:51:02 AM UTC-8, jb wrote:

 Dear All, 

 I am using an intent to invoke a file chooser. 
 Some of the file chooser applications return an 
 Uri of scheme file others return an Uri of 
 scheme content. 

 I need to obtain the last modified date of the 
 chosen object. How do I do that? I didn't find 
 an appropriate API. There is some API that returns 
 a FileDescriptor. But I don't get the last modified 
 date from a FileDescriptor. 

 Any help appreciate. 

 Best Regards 



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


[android-developers] Re: Android API for editing video.

2014-02-04 Thread Doug
Nothing exists for high level editing functions, if you mean operations 
like copying and moving sections of video.  On ICS you have direct access 
to the low level A/V codecs on the device, but that's a lot of work to 
manipulate at such a low level for the purpose of editing.

Doug

On Sunday, February 2, 2014 8:15:25 AM UTC-8, Yatish wrote:

 Hi ,

 I am looking for android APIs or lib for editing Video. I wan to create an 
 application which will use for editing videos. 


 Please provide your valuable suggestions.

 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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: Android how to manage the text size for different screen sizes.

2014-02-01 Thread Doug
How are you measuring your font sizes?  If you're not using sp units in the 
xml from which the text was inflated, you're not doing things the best 
possible way.

Doug

On Saturday, February 1, 2014 11:52:00 AM UTC-8, 12169 wrote:

 Hi,

 I have an application and  text size looks very fine on 4.7 inch 
 device.but when run the application on 7  and  2.3 inch devices it look 
 very bad.what is best way to manage the text size for different screen 
 sizes. 


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: Using CSS Height Attributes in Android App Screen

2014-01-25 Thread Doug
Try using a Javascript library (such as jQuery) to compute pixels that are 
understood internally by the WebView rather than trying to convert 
something from Android's reckoning of pixels.  You could have it trigger on 
window resize to compute and set the size that corresponds to the relative 
amount of space you want.

Doug

On Friday, January 24, 2014 3:18:04 PM UTC-8, Cayce wrote:

 I have an Android app that delivers live text content in various div 
 blocks that have to maintain a relationship with each other. The obvious 
 problem is that using pixel values in attributes renders differently in 
 different devices, such as the Galaxy S4 and the Nexus 7, which both pull 
 from the xxhdpi database, but have different viewport specs. So the best 
 method I've found is to apply percentages instead of pixel values. This 
 works fine on width attributes, but height attributes just collapse.

 Is there a known workaround for getting height by % to render in the 
 Android app environment?

 Thanks much.

 Cayce


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: LinearLayout as child of ScrollView and View weight's are being ignored

2014-01-02 Thread Doug
It sounds like you maybe want to use different layouts for different screen 
types rather than depending on sizes of images for different pixel 
densities.  I recommend you read and understand the majority of this 
document to fully understand how Android deals with different screens and 
what kind of options you have:

http://developer.android.com/guide/practices/screens_support.html

Doug


On Wednesday, January 1, 2014 7:04:05 AM UTC-8, stanlick wrote:

 Thanks Doug!

 This is what I was thinking, but always like a second opinion.  I think 
 I'm going to study the the various image size folders drawable-ldpi, 
 drawable-mdpi, 
 etc., and include form-factor appropriate images.  It's a shame, Android 
 could not take the highest resolution image and scale it down to fit the 
 other form factors.  Heck maybe it does with the scaleType and I'm just 
 confused by the ScrollView overriding my layout decisions.  The smallest 
 device, as I see it, is the 240x320 (is that a watch) and it certainly 
 wants smaller pics than my 90 TV!

 Peace,
 Scott

 On Tuesday, December 31, 2013 1:22:03 PM UTC-6, Doug wrote:

 Weights only make sense when the container of the LinearLayout is 
 constraining the height of it.  With its height constrained, LL is then 
 forced to impose heights on all of its children.  It will use weights to do 
 this if you specify them.

 When the container of a LL is a ScrollView, the SV doesn't impose a 
 constraint on the height of the LL, which means the LL doesn't impose a 
 height on its children.  It lets them all be as tall as they want.  The SV 
 will then allow the user to scroll to see the entire contents of the LL if 
 it overflows the ScrollView's height.

 If you want everything to be constrained to fit on the screen, don't use 
 a ScrollView.  If you want to allow scrolling, then accept that the LL will 
 not impose a height on its children.  If you want to constrain the height 
 of just one child in a LL, then give it an explicit height measurement in 
 dp to override its natural height measurement.

 Doug

 On Monday, December 30, 2013 2:39:16 PM UTC-8, stanlick wrote:

 I have a LinearLayout with three views on it TextView, ImageView 
 and TextView.  The image was pushing the third TextView off the bottom of 
 the screen, so I added weight to the three views.  Now when I place this 
 LinearLayout on a ScrollView, the weights are being ignored!  Is there a 
 way to constrain the size of an image without hardcoding pixels?  I have 
 tried every android:scaleType available and nothing works quite right.



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: ViewPager and ListFragments with onLongClick listener problem

2013-12-31 Thread Doug Gordon
1) It seems like you could figure this out just by setting a few 
breakpoints and following what happens when the long-press menu is 
activated.

2) Do you really have a separate copy of code for each fragment that differ 
only by the FRAGMENT_DAY_NAME constant? This is bad practice for a number 
of reasons plus the extra work required (if you find a bug, you'll have to 
make edits in all those modules?).

On Friday, December 20, 2013 11:10:44 AM UTC-5, Paul-Peter Tournaris wrote:

 Hello to everyone! I tried asking this in StackOverflow and had to no luck 
 so you are my last hope! 


 http://stackoverflow.com/questions/20681055/viewpager-and-listfragment-with-onlongclick-strange-behaviour

 The problem is clearly described in the above link! If you want me to 
 clarify anything more please feel free to tell me and i will answer asap!

 Thank you in advance!

 -- 
 *Παύλος-Πέτρος Τουρνάρης*
 *Android   Software Developer*

- http://about.me/pavlospt
- *http://acschedule.org http://acschedule.org*

 

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


[android-developers] Re: LinearLayout as child of ScrollView and View weight's are being ignored

2013-12-31 Thread Doug
Weights only make sense when the container of the LinearLayout is 
constraining the height of it.  With its height constrained, LL is then 
forced to impose heights on all of its children.  It will use weights to do 
this if you specify them.

When the container of a LL is a ScrollView, the SV doesn't impose a 
constraint on the height of the LL, which means the LL doesn't impose a 
height on its children.  It lets them all be as tall as they want.  The SV 
will then allow the user to scroll to see the entire contents of the LL if 
it overflows the ScrollView's height.

If you want everything to be constrained to fit on the screen, don't use a 
ScrollView.  If you want to allow scrolling, then accept that the LL will 
not impose a height on its children.  If you want to constrain the height 
of just one child in a LL, then give it an explicit height measurement in 
dp to override its natural height measurement.

Doug

On Monday, December 30, 2013 2:39:16 PM UTC-8, stanlick wrote:

 I have a LinearLayout with three views on it TextView, ImageView 
 and TextView.  The image was pushing the third TextView off the bottom of 
 the screen, so I added weight to the three views.  Now when I place this 
 LinearLayout on a ScrollView, the weights are being ignored!  Is there a 
 way to constrain the size of an image without hardcoding pixels?  I have 
 tried every android:scaleType available and nothing works quite right.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: part of text to bold when using AlertDialog.setMessage .

2013-12-17 Thread Doug
Pass a custom view to AlertDialog with that view containing a TextView with 
the Spanned being returned from Html.fromtHtml.  Don't use the 
AlertDialog's setMessage since that only accepts regular strings and not 
Spanned strings with markup.

Doug

On Sunday, December 15, 2013 11:04:32 PM UTC-8, rahul kaushik wrote:

 How to set part of text to bold when using AlertDialog.setMessage .

 I googled and also tried 
 Html.fromHtml(b+getString(R.string.your_message)+/b)

 but no Help!

 Please Suggest

 Thanks
 RK


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: WeakReference containing callback interface

2013-12-16 Thread Doug
I don't know what AndroidQuery does for you exactly, but there is a general 
rule about how callbacks for asynchronous callbacks can work without 
leaking.  If you need to hold a reference to anything at all related the 
activity or UI that needs to be updated as a result of some async work, 
hold only a weak reference to that object, and check it for null before 
doing anything with it.  Also, don't define you callbacks as non-static 
inner classes in your activities, or the callback object will be implicitly 
holding a strong ref to the enclosing object (the activity) that will 
prevent it from being gc before the work ever ends.

It doesn't make sense for the callbacks themselves to be held as weak 
references.  The thing performing the work needs to hold the callbacks 
strongly since that may be the only reference to them at any moment.

Also, consider Picasso if you're trying to do async image loading.

Doug

On Wednesday, December 11, 2013 6:43:56 AM UTC-8, TheNetStriker wrote:

 I've got a question regarding WeakReferences in Android. I'am using 
 AndroidQuery in my app to load images asynchronous. I've modified the 
 AndroidQuery source a bit, so that it is also able to send progress 
 callbacks so that I can update the progressbars in my notifications. The 
 problem is that the progress object in AndroidQuery is referenced as 
 a WeakReference so that references to progressbars which are no longer 
 visible on the UI are getting garbage collected. The problem now that 
 AndroidQuery works with an ExecutorService and that my callback objects 
 also are getting garbage collected when the Runnable has to wait for its 
 execution. I could change the WeakReference to a hard one to fix this 
 proboem, but then I would have memory leaks when referencing progressbars 
 directly. Here is how I pass the callback interface to AndroidQuery:

 aq.progress(new ProgressCallback() { 
 @Override
 public void setProgress(final int progress) {
  //update progressbar
 }
  @Override
 public void setMax(int max, int progress) {
  //update progressbar
 }
 })

 Is there a way to pass such a callback object without loosing the 
 reference when it is referenced inside an WeakReference object?


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To 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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Google Drive says Action Bars on the bottom are ok?

2013-12-15 Thread Doug
Hamburger menu.

On Saturday, December 14, 2013 7:17:44 PM UTC-8, Nathan wrote:

 Somewhat related. 

 What's that thing called on Gmail where they got three bars in the upper 
 left that slides out to become a menu on the left? 


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: Passing the design for tablets checks (dev console optilmization tips)

2013-11-23 Thread Doug Gordon
My app seems to have passed the tests once I added some 7-inch tablet 
screen shots. I do have some resources in folders with the *-xlarge*attribute, 
so maybe that's a clue to what they're looking for.

On Friday, November 22, 2013 4:20:28 PM UTC-5, b0b wrote:


 I have an app that I think is tablet friendly yet the dev console 
 optimization tips report:

 Your layout should make use of the available space on tablets

 Great. It point to this page to solve it:
  
 http://developer.android.com/distribute/googleplay/quality/tablet.html#use-extra-space

 The problem is that it is a bit vague about what exactly is required to 
 pass this requirement.

 - does it check for layout-sw600dp and res/layout-sw720dp   (my app only 
 has the former) ?
 - does it check for XML Fragment declaration ?
 - etc...

 What is exactly required is not crystal clear...



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] xxHdpi Displays

2013-11-12 Thread Doug Gordon
Having just bought a Nexus 5 (great smartphone, BTW!!), I see that I 
apparently missed the introduction of these xxhdpi devices (480ppi 
class). It doesn't appear that all of the Android developers' pages have 
been fully updated for these screens, but are we officially supposed to 
now be providing graphic resources in  a drawable-xxhdpi resource 
subfolder?


That's about all I need is yet another set of graphics to resize and 
tweak endlessly! :-(


Doug Gordon
GHCS Software

--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: Drawing rapidly into Bitmap from non-UI thread results in Cannot generate texture from bitmap

2013-11-06 Thread Doug
Generally speaking, anything that updates the UI is supposed to be done on 
the main thread.  What you're doing sounds suspiciously apt to have 
problems unless something in Android documentation validates your approach.

If you want to render stuff into a view off the main thread, consider 
instead using SurfaceView and its SurfaceHolder.  It specifically has 
provisions for drawing to its Canvas off the main thread.

Doug

On Tuesday, November 5, 2013 7:09:20 AM UTC-8, Michael Zoech wrote:

 Hi,

 In my current application that I'm developing I draw into an 
 android.graphics.Bitmap object from a non-UI thread. This is done from 
 native code via the AndroidBitmap_lockPixels and AndroidBitmap_unlockPixels 
 calls. Every time the drawing has finished, the UI thread gets notified 
 that the Bitmap has changed and the responsible View in the Activity is 
 invalidated and redrawn. All code that accesses the Bitmap is synchronized 
 on the Bitmap.

 The issue that I'm seeing is that if the rendering is too fast, after some 
 time the View is no longer updated and in the log the following is logged:

 E/OpenGLRenderer ... Cannot generate texture from bitmap

 None of the drawing calls produce any errors that anything is wrong.

 Searching on the internet reveals a few others who had similar issues, but 
 no real solutions or answers for that specific problem. Is it even allowed 
 to draw into the Bitmap from a non-UI thread? Is there a different way to 
 do something similar? I tried using just an IntBuffer and drawing the 
 IntBuffer in the view. While this works, it is also 2x slower than using a 
 Bitmap.

 Thanks,
 Michael



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: Deposits From Google Wallet Weirdness

2013-07-18 Thread Doug Gordon
According to Bank of America's site, all three payouts did go into my 
account. I guess the simplest thing would be to just consider it an 
advance for the next couple of months. At least it wasn't like the guy 
whose Paypal account got an erroneous balance of 94 quadrillion dollars the 
other day!

On Tuesday, July 16, 2013 5:27:30 PM UTC-4, Nathan wrote:

 Any one else seen weird things with Google Wallet?

 Like many of you, I have recently been forced into the highly inferior 
 Google Wallet interface from Google Checkout. 

 So should I be concerned if, say, Google Wallet says that they have 
 deposited the monthly deposit at least three times today?

 Not that I would complain if I really thought I could just keep it. But 
 only one really arrived in the bank account, and I hope the IRS is not 
 going to ask what I did with the other two. 

 I have already contacted Google Wallet through their form that says Be 
 aware that we cannot respond to every request . . . 

 Is this just another silly thing I should let take care of itself?

 Note to Google: Our accountants hate you. 

 Nathan



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Overloading of Back Key functionality

2013-05-06 Thread Doug Gordon
Excuse me for a minor rant, but is anyone else bothered by what I call 
the overloading of the Android Back key? What I mean by this is that 
pressing it can have two vastly different results: it can return you to 
an earlier view in the app you are using, or it can effectively exit 
the app and return to the previous app or home screen.


In the original concept (?) of Android, this can work well. For example, 
you have an app with a View on Map control. Tap it and you throw out 
an Intent that's picked up by Google Maps. When you're done, you press 
the Back key and return to the original app. Fine.


However -- and for me this is a big however -- many if not most apps are 
a lot more complex and are more in the nature of standalone programs. 
When running these apps, the Back key is used to back up to previous 
viewing states of the app, such as returning from an article to the 
table of contents. Trouble is, it's not always obvious or easy to 
remember the hierarchy of the app contents, and I don't know how many 
times I press the Back key expecting to return to another state of the 
app and instead find myself looking at the home screen!


An example: The user runs a weather app and it displays the weather for 
her location. She decides to look at the weather in another city and 
uses some control to select it. At this point it is easy to assume that 
pressing the Back key will return the app to the previous city's data, 
but that's not how it works: pressing that key exits the app.


My own app has this situation, and even when using it myself I sometimes 
accidentally exit it instead of going back to an earlier set of 
details. I notice that some apps have put in an Are you sure you want 
to exit? dialog that helps prevent this, but it would seem it would be 
a lot cleaner if this were not necessary.


--
--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: Playing HLS (Http Live Stream) using Android VideoView (ICS 4.0.3 and 4.0.4)

2013-04-22 Thread Doug
VideoView is just a convenience for manipulating a ViewHolder and a 
MediaPlayer.  It's educational to find it's source and study it a bit.

MediaPlayer is just a kind of remote control for the native media 
components deep inside android (e.g. stagefright).

The problems you're seeing are likely not a problem with VideoView or 
MediaPlayer, but the stuff deep inside Android, or maybe even the 
particular device you're working with.

Doug

On Monday, April 22, 2013 3:43:43 AM UTC-7, A_User wrote:

 I am writing an application for playing HLS video stream using android 
 VideoView component. 
 My HLS video stream is variable bit rate video stream varing from 200KBps 
 to 2 Mbps.

 Issue is that When VideoView switches video stream from 200 KBps to 700 
 Kbps (Or from any low bitrate stream to high bitrate video stream) my video 
 becomes green or garbage and never recovers, Also sometimes my video gets 
 freeze and I can only hear audio progressing and in this case also video 
 never recovers. 

 Is this known issue with VideoView?
 Has anybody faced this kind of issues with VideoView. 

 When I test same code on android Jelly bean then every thing works 
 properly. 



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: Which is more suitable for uploading large files? a service on separate process or ...

2013-04-18 Thread Doug
I would definitely dedicate a service for things that do persistent work in 
the background.  There is no real advantage to using a separate process 
unless your upload needs a truckload of memory.

Doug

On Thursday, April 18, 2013 12:21:47 AM UTC-7, AndroidCompile wrote:

 Hi,
 When an application needs to upload many large files, which would be a 
 better solution:
 1) Doing this on a separate process (i.e. remote service)?
 2) Using a separate thread (or AsyncTask)?

 Is there a clear and definite answer to this?

 The application, by the way, is uploading things all the time - usually 
 very small chunks of data. 
 Every now and then it needs to send large files, so I want to do that with 
 a separate mechanism then the one I am using.
 (BTW for the small chunks I am using a single task thread which works 
 great)


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: error message displays on gingerbread emulator but not icecream sandwich emulator

2013-04-17 Thread Doug
 Binary XML file line #6: Error inflating class fragment 

Fragments are not available in GB unless you are using the compatibility 
library and using only the fragment objects and activities available 
through it.

Doug


On Tuesday, April 16, 2013 2:48:06 PM UTC-7, John Merlino wrote:

 I have an app which uses google maps api v2. Works fine in api level 
 15, but in api level 10 (gingerbread) on the real device it says there 
 is no support. When I try to run on gingerbread emulator, I get the 
 following error: 

 04-16 17:42:00.928: E/AndroidRuntime(363): FATAL EXCEPTION: main 
 04-16 17:42:00.928: E/AndroidRuntime(363): java.lang.RuntimeException: 
 Unable to start activity ComponentInfo{com.otl.AndroidRemoteApp1/ 
 com.otl.AndroidRemoteApp.ShowMapActivity}: 
 android.view.InflateException: Binary XML file line #6: Error 
 inflating class fragment 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 
 1647) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 
 1663) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.app.ActivityThread.access$1500(ActivityThread.java:117) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.os.Handler.dispatchMessage(Handler.java:99) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.os.Looper.loop(Looper.java:130) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.app.ActivityThread.main(ActivityThread.java:3683) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 java.lang.reflect.Method.invokeNative(Native Method) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 java.lang.reflect.Method.invoke(Method.java:507) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 com.android.internal.os.ZygoteInit 
 $MethodAndArgsCaller.run(ZygoteInit.java:839) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 dalvik.system.NativeStart.main(Native Method) 
 04-16 17:42:00.928: E/AndroidRuntime(363): Caused by: 
 android.view.InflateException: Binary XML file line #6: Error 
 inflating class fragment 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.view.LayoutInflater.rInflate(LayoutInflater.java:623) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.view.LayoutInflater.inflate(LayoutInflater.java:408) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.view.LayoutInflater.inflate(LayoutInflater.java:320) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.view.LayoutInflater.inflate(LayoutInflater.java:276) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java: 

 207) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.app.Activity.setContentView(Activity.java:1657) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 com.otl.AndroidRemoteApp.ShowMapActivity.onCreate(ShowMapActivity.java: 
 45) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 
 1047) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 
 1611) 
 04-16 17:42:00.928: E/AndroidRuntime(363): ... 11 more 
 04-16 17:42:00.928: E/AndroidRuntime(363): Caused by: 
 java.lang.ClassNotFoundException: android.view.fragment in loader 
 dalvik.system.PathClassLoader[/system/framework/ 
 com.google.android.maps.jar:/data/app/com.otl.AndroidRemoteApp1-2.apk] 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 java.lang.ClassLoader.loadClass(ClassLoader.java:551) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 java.lang.ClassLoader.loadClass(ClassLoader.java:511) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.view.LayoutInflater.createView(LayoutInflater.java:471) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.view.LayoutInflater.onCreateView(LayoutInflater.java:549) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:
  

 66) 
 04-16 17:42:00.928: E/AndroidRuntime(363): at 
 android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568) 
 04-16 17:42:00.928: E/AndroidRuntime(363): ... 20 more 

 Anyone understands

[android-developers] Re: How to detect if music is playing?

2013-04-14 Thread Doug
http://developer.android.com/reference/android/media/AudioManager.html#isMusicActive()

Doug

On Saturday, April 13, 2013 5:11:53 AM UTC-7, MobileVisuals wrote:

 Is there any way to detect if music is playing from players like Spotify 
 and Winamp?

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: Adjust ActionBar Tabs Width

2013-02-16 Thread Doug Gordon
If you hide the app title and icon and use the splitActionBar option, you 
can get up to 4 tabs on the top row on a smartphone-size screen. I think 
that 4 is about the limit, but if there is not enough room for all the tabs 
in the top row, Android converts the tabs to a spinner (dropdown) selector. 
This works OK, but then is not as convenient as having the tabs.

On Saturday, February 16, 2013 12:59:25 AM UTC-5, sree wrote:

 Hi 
 see The above attachment.
 I implemented ActionBar tabs,But when i add more than 3 tabs it is going 
 back of the screen.so i need to adjust width for each tab.How can i do it.
 actually i need to implement 5 tabs.

 Thank you 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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Unexpected Action Bar Behavior

2013-02-01 Thread Doug Gordon
I've just updated my app to use an ActionBar with navigation tabs and 
the splitActionBarWhenNarrow option, integrated with ViewPager to allow 
swiping between tabs. The home icon and title in the bar are disabled.  
It is functionally working on all configurations, but in one case it 
doesn't act as I would expect.


When on a smartphone in portrait config, the Action Bar splits with the 
tabs in the top bar and the menu/action items in the bottom bar. Of 
course I can select a page by tapping a tab, and when I swipe from page 
to page the tab selection highlight (underbar) moves to the selected 
tab. So far so good.


When I turn the device into the landscape position, I now get a single 
Action Bar at the top. The action and overflow menu icons are at the 
right, and Android has turned my tabs into a dropdown selector on the 
left side. This works OK when I use the selector to change pages, but 
when I swipe from page to page the selector *does not change* to 
indicate the current tab.


My code of course does not change depending on configuration, and I set 
breakpoints to show that onPageSelected is called, which calls 
bar.setSelectedNavigationItem, causing onTabSelected to be called in 
turn. So the expected actions are taking place, but the selector in the 
dropdown does not change.


Any ideas what is going on?

(For what it's worth, in landscape position on a tablet, I get yet 
another variant: a single Action Bar with my tabs on the left and action 
items on the right. In this case, the tab highlight correctly follows 
when swiping.)


  Doug Gordon
   GHCS Software

--
--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: Fragment Transition Animation Crashes

2013-01-29 Thread Doug Gordon
Thanks. I did manage to discover that I needed to specify R.*animator*.fade_in, 
etc. One of those changes that is easy to miss if you do not always follow 
every release note, etc.

On Monday, January 28, 2013 5:46:37 AM UTC-5, Kostya Vasilyev wrote:

 The native fragment API uses the new (since 3.0) animators.

 http://developer.android.com/guide/topics/graphics/prop-animation.html

 You can see the difference in the source, too:


 https://android.googlesource.com/platform/frameworks/support/+/refs/heads/master/v4/java/android/support/v4/app/FragmentManager.java


1. Animation anim = AnimationUtils.*loadAnimation*(
mActivity, fragment.mNextAnim);



 https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/java/android/app/FragmentManager.java


1. Animator anim = AnimatorInflater.*loadAnimator*(
mActivity, fragment.mNextAnim);


 -- K

 On Monday, January 28, 2013 4:14:36 AM UTC+4, Doug Gordon wrote:

 The following code used to work fine in a previous iteration of my app 
 that was targeted to V11 but used the support library to support 
 fragments, etc., from the minimum V7 and up: 

  Fragment frag = 
 ShowExhibit.ShowExhibitFrag.newInstance(args); 
  FragmentTransaction ft = 
 mFrag.getFragmentManager().beginTransaction(); 
  ft.setCustomAnimations(android.R.anim.fade_in, 
 android.R.anim.fade_out, 
  android.R.anim.fade_in, android.R.anim.fade_out); 
  ft.replace(mParentId, frag); 
  ft.addToBackStack(null); 
  ft.commit(); 

 Now I'm creating a new version that targets V14 and also has a min of 
 V14, so no need to use the support library for fragments. Running this 
 on the emulator running Android 4.0 (V14), I get the following fatal 
 error on the transition: 

 FATAL EXCEPTION: main 
   java.lang.RuntimeException: Unknown animator name: alpha 
   at 
 android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:129)
  

   at 
 android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:93)
  


 So what has changed? I can load my previous app version on this same 
 emulator and it runs just fine. None of the code related to this 
 operation has changed in any way. The emulator was created using the 
 standard Galaxy Nexus definition within ADT. 



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Fragment Transition Animation Crashes

2013-01-27 Thread Doug Gordon
The following code used to work fine in a previous iteration of my app 
that was targeted to V11 but used the support library to support 
fragments, etc., from the minimum V7 and up:


Fragment frag = ShowExhibit.ShowExhibitFrag.newInstance(args);
FragmentTransaction ft = 
mFrag.getFragmentManager().beginTransaction();
ft.setCustomAnimations(android.R.anim.fade_in, 
android.R.anim.fade_out,

android.R.anim.fade_in, android.R.anim.fade_out);
ft.replace(mParentId, frag);
ft.addToBackStack(null);
ft.commit();

Now I'm creating a new version that targets V14 and also has a min of 
V14, so no need to use the support library for fragments. Running this 
on the emulator running Android 4.0 (V14), I get the following fatal 
error on the transition:


FATAL EXCEPTION: main
 java.lang.RuntimeException: Unknown animator name: alpha
 at 
android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:129)
 at 
android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:93)


So what has changed? I can load my previous app version on this same 
emulator and it runs just fine. None of the code related to this 
operation has changed in any way. The emulator was created using the 
standard Galaxy Nexus definition within ADT.


--
--
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: Use unrooted Android device to test web site running on desktop, through usb cable?

2012-12-26 Thread Doug
The easiest thing is to put them on the same network and point the mobile 
browser to the desktop's IP address and port that is hosting the web server.

Doug

On Tuesday, December 25, 2012 4:24:27 PM UTC-5, David Karr wrote:

 If I have an unrooted Android device, a USB cable, and a laptop, can I run 
 a web or application server on my laptop and test a site running on that 
 server on the Android device?

 I know I can do some testing with the Android emulator, but I'd like other 
 options.


-- 
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] Kudos to ADT package developers

2012-11-28 Thread Doug Gordon
Having just bought a new PC, I wasn't particularly looking forward to 
installing my Eclipse/Android development environment yet once again and 
could only hope to find my old notes on what to install, what settings 
to  make, etc. So I was pleasantly surprised to find that this has been 
packaged into a single download that almost instantly gets me back to 
being productive. I think the only thing I needed to do was to tell it 
where the SDK was and download some earlier platforms.


So thanks to whoever it was that did this work -- greatly appreciated!

Doug Gordon
GHCS Software

--
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] Windows 8

2012-11-21 Thread Doug Gordon
My development PC just took a dive, and most of the decent PCs that I can 
find locally are now coming with Windows 8. I really don't want to go that 
route, but if I do, will the Android development environment, i.e., Eclipse 
and the various SDK tools, run OK on Windows 8? And how about drivers for 
Android 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] FrameLayout in ViewSwitcher doesn't resize

2012-11-09 Thread Doug Ponsford


Hi All, I have a problem with a FrameLayout inside a 
LinearLayout/ViewSwitcher which has been dogging me for days! Any help 
would be appreciated:

In the XML, I have a LinearLayout that defines a background theme, a 
ViewSwitcher inside that, and a LinearLayout in the first (upper) half of 
the ViewSwitcher. The upper half of the ViewSwitcher has several TextViews 
and a FrameLayout which places the frame in the bottom-right-hand corner of 
the screen. I insert a live image from the camera into that FrameLayout. So 
far, so good!

The 2nd half of the ViewSwitcher only has a single FrameLayout in it, in 
which I also insert the live camera view. I want this 2nd FrameLayout to 
fill the screen inside the background - but it doesn't.

The first screen and the swiping between the 2 switchable views works OK, 
but I can't get the single FrameLayout in the 2nd screen to fill the view 
(the background theme has a full-width button at the top and bottom - this 
displays OK). The 2nd switched view still has the small video frame in it. 
I've tried everything I can think of and searched what feels like every 
single relevant post on SO, but I can't get the 2nd FrameLayout to fill the 
screen.

I've tried putting the 2nd FrameLayout inside it's own LinearLayout, but to 
no avail.

If I move the single FrameLayout to the upper half of the ViewSwitcher (so 
that it appears first on onCreate), then I get the full-screen video image 
that I want, but then switching to the 2nd view gives me no video frame at 
all (but all the text views are there)!
Setting android:measureAllChildren=false in the XML and 
switcher.setMeasureAllChildren(false); in the code makes no difference.
 
Here's the XML...

?xml version=1.0 encoding=utf-8? 
LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
style=@style/background
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=vertical 

ViewSwitcher 
android:id=@+id/viewswitcher
android:layout_width=fill_parent
android:layout_height=0dp
android:measureAllChildren=false
android:layout_weight=1 

!-- 
***
V I E W   O N E
***
--
LinearLayout
android:layout_width=match_parent
android:layout_height=match_parent
android:layout_marginLeft=1sp
android:orientation=horizontal 

LinearLayout 
android:layout_width=wrap_content
android:layout_height=match_parent
android:layout_marginRight=5sp
android:orientation=vertical 

TextView 
android:id=@+id/txt1
style=@style/normaltext
android:layout_width=match_parent
android:layout_height=wrap_content
android:layout_margin=1sp
android:text=@string/str1 /


TextView
android:id=@+id/txt3
style=@style/normaltext
android:layout_width=match_parent
android:layout_height=wrap_content
android:layout_margin=1sp
android:text=@string/str2 /
/LinearLayout

LinearLayout 
android:layout_width=100dp
android:layout_height=wrap_content
android:layout_marginLeft=1sp
android:layout_marginRight=1sp
android:layout_weight=0.38
android:orientation=vertical 

TextView 
android:id=@+id/txt4
style=@style/normaltext
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_marginTop=1sp /



TextView 
android:id=@+id/txt5
style=@style/normaltext
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_marginTop=1sp
android:text=@string/str3 /

LinearLayout 
android:layout_width=match_parent
android:layout_height=match_parent 

FrameLayout 
android:id=@+id/camimage
android:layout_width=match_parent
android:layout_height=wrap_content 
/FrameLayout

/LinearLayout

/LinearLayout

/LinearLayout

!-- 
***
V I E W   T W O
***
--
LinearLayout
android:layout_width=fill_parent
android:layout_height=fill_parent
android:measureAllChildren=false
android:layout_weight=1 

FrameLayout 

[android-developers] Re: IllegalStateException after ListView's adapter has changed

2012-09-20 Thread Doug Turner
Jayesh Salvi jayeshsalvi at gmail.com writes:

 
 
 Hi,This is regarding the exception:  java.lang.IllegalStateException: The
content of the adapter has 
 changed but ListView did not receive a notification. - seen on Android
1.6+This problem has been discussed in the past [1][2][3][4], and I have
followed all the solutions suggested in those threads. However, few of my users
still hit this crash. So I did some source code lookup and have some
questions.Here is the description of what my app is doing:I use a ListView and
populate it with an adapter. The adapter is a direct derivative of BaseAdapter.
I populate the list progressively. As the items are downloaded from network they
get added to the adapter. The fetching of items is done in doInBackground() and
when they are ready to get added to the adapter I invoke publishProgress(), in
the onProgressUpdate() method I add new items one-by-one to the adapter. As soon
as I add the item to the adapter, I invoke notifyDataSetChanged().I believe this
is as per the best practices that Android developers have suggested in above
mentioned threads.Despite this I get crash reports with this exception. They are
rare, but not as rare as ignorable. I myself have hit this crash on my
phone/emulator only 1-2 times in last couple of months. The user reported
crashes are roughly 1 to 3 per day (approx. at least 600 users use the app per
day) (A minority of users may be hitting this crash over and over again)
 
 . This leads me to believe that my adapter update logic is mostly right, but
not full proof. So I dug into the source code of ListView and BaseAdapter.The
exception is thrown because ListView's mItemCount doesn't match the underlying
adapter's item count. It happens in layoutChildren() [ListView.java line 1432]
 
  } else if (mItemCount != mAdapter.getCount()) {             
  throw new IllegalStateException(The content of the adapter has changed but  
                      + ListView did not receive a notification. Make sure the
content of 
 
 So in order to avoid this from happening mItemCount should be updated as
soon as the adapter has changed its content. So I searched for locations in the
code where mItemCount is updated. I found two locations doing that. In
setAdapter() [ListView.java 431] and in onMeasure() [ListView.java 1033].
Consequently, if I am updating the adapter then either setAdapter() or
onMeasure() should be executed before the comparision in layoutChildren() takes
place, otherwise the exception will be thrown.My question is, is it possible
that my code in onProgressUpdate() that appends to adapter can get executed
between onMeasure() and layoutChildren() of the ListView? AFAIU, all three of
these methods (onProgressUpdate, onMeasure, layoutChildren) run on the same GUI
thread.I call notifyDataSetChanged immediately after I add to adapter in
onProgressUpdate(). I looked into its source code. It calls methods on
DataSetObservable and DataSetObserver. I couldn't find how it could directly
lead to the updating of mItemCount of the ListView, clearly I don't know much of
the internal layout code.Please let me know what you think. I am trying to
understand this mechanism as thoroughly as possible. Thanks in advance.Links:[1]
http://www.mail-archive.com/android-developers at 
googlegroups.com/msg60355.html
 
 [2] http://www.mail-archive.com/android-developers at
googlegroups.com/msg65814.html[3]
http://groups.google.com/group/android-developers/browse_thread/thread/77722caa85f87697
 
 [4]
http://groups.google.com/group/android-developers/browse_thread/thread/a451221261cb6a93/2ab5bea015c38437?lnk=gstq=For+Google+about+BaseAdapter+class#2ab5bea015c38437
 
 [5] ListView.java source code I refered to:
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/ListView.java;h=7c8151e65132a91aecadd2048fe205bd1c6768a9;hb=HEAD--Jayesh
 


Hello Jayesh. 

Were you able to resolve the issue you were having? I am getting the same
IllegalStateException, but it seems like this happens only when scrolling.

Thanks,
- Doug




-- 
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: Async pattern required (professionals welcome)

2012-09-05 Thread Doug
It sounds to me like you are aware of everything you need to know to 
construct a solution that works for you.  Fire up your threads and get to 
it!  To really do this right, though, you need an http fetcher, a disk 
cache for fetched images, and a memory cache for only the most recently 
fetched images.  And you need to check each one of these in reverse order 
to get the best performance for a ListView with images that must scroll 
quickly.

Overall, this is not exactly an easy problem to solve.  I just shipped a 
solution for a prominent app I work on, and it took weeks of work and 
several eyeballs to iron out all the details.

Doug

On Wednesday, August 29, 2012 12:25:31 PM UTC-7, itai wrote:

 I’m struggling to figure out a straight forward design for the 
 following scenario: 

 A user clicks a button which results in sending an http request 
 asynchronously to fetch a list of image URL’s (e.g some json 
 collection response). 
 Upon completion, a ListView would need to be populated with the images 
 referenced by the URL’s (e.g each list view item would issue its own 
 async http requests to download and display the image). The image 
 being downloaded will always be the most recent for the proper 
 recycled image. 

 I’m concerned about three situations: 

 1. Configuration change can happen at any stage which will replace the 
 Activity instance receiving the async results with a new instance, 
 hiding already displayed images – My understanding is that the 
 solution for this is to maintain a some list of all active async tasks 
 on the initiating instance and transfer them all together in 
 onRetainNonConfigurationInstance(), However; my concern here is from 
 the doc’s: “This function is called purely as an optimization, and you 
 must not rely on it being called”, Does this mean that a configuring 
 change can happen and function won’t be called ?@! 

 2. A different activity comes into the foreground, causing the 
 executing activity to be in pause state while still getting updates 
 from the in-progress async operations – Here I’m not sure if there is 
 any violation (e.g updating an Activity UI in pause state). 

 3. A different activity comes into the foreground, causing the 
 executing activity to be paused and subsequently killed (the entire 
 process is killed) due to memory pressure - In this case I would want 
 to: 

 a. Know that this is the case before it happens. 

 b. Save to persistent storage all the *new* images if and only If all 
 the downloads have completed, if not, I would like to save all 
 existing images that where present before the whole download process 
 kicked in (if present from a past download). 
 That way if the user navigates back to Activity and the process is 
 recreated, I can load the persisted information and have the user see 
 a snapshot of images either from a previous request or a new request 
 (no interleaving) 

 Initially I was inclined to use AsyncTask’s (1 AsyncTask for getting 
 the Url’s and X others for the images) and use 
 onRetainNonConfigurationInstance, to correct instance binding in case 
 of a configuration change… )I have yet to figure out how to detect the 
 process recycling case from configuration change before hand as there 
 is no defined order between onSaveInstanceState / 
 onRetainNonConfigurationInstance and I don’t want to persist the 
 information at every configuration change). However, after watching 
 Virgil’s google i/o presentation “Building Rest Clients” it seems 
 there is a recommended approach, to perform all the network calls 
 through a service which is supposed to decrease the likelihood of the 
 process from being killed. However, after further investigating this 
 it seems like a major overkill with many pitfalls of its own as it 
 requires implementing a 2 way messaging protocol possible involving 
 queuing messages, with no obvious way on how to handle callbacks in a 
 way that address the concerns outlined above, so I prefer to avoid 
 this risk unless absolutely required. 

 So to sum up, I would really appreciate a professionals feedback on 
 this, as I'm kind of new to android... so if you feel like sharing an 
 *explanation* on how to do this right, great!! 

 If you feel this is work and you can provide a concise and *correct* 
 sample that address all the concerns above, I would be happy 
 compensate, pypal works :) 

 -Itai 

 e: itaitai2003 … the at sign … yahoo .. com 

 p. s 

 No need for actual communication/imaging or persistence logic, simple 
 mock will do, without Fragments – I don’t use them, I don’t need them 
 in my project. 


-- 
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: simulate just onPause() without onStop()

2012-08-28 Thread Doug
On devices running gingerbread or older (I think), just turn off the screen.

Or start an activity whose theme is transparent (or something like that, 
google it).

Sorry to be so imprecise.

Doug

On Tuesday, August 21, 2012 10:04:03 PM UTC-7, Ubuntu guy wrote:

 Hello, 

I'm developing an application and need to quickly test a scenario 
 where my activitiy's onPause() is invoked (without onStop()). 
 As per the documentation, this is a scenario where a dialog is shown 
 on top of my activity. I tried long press of power down button to pop 
 up a dialog, however, it doesn't invoke a onPause() at all. 

Is there any easy way to simulate this scenario? 

 Thanks in advance ! ! ! 


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

[android-developers] Re: VideoView seetTo() takes longer time to start video after pause

2012-08-28 Thread Doug
seekTo doesn't restart a paused video.  Seeking is independent of playback 
state.

Doug

On Wednesday, August 22, 2012 3:57:33 AM UTC-7, Ashutosh wrote:


 did you get any solution for this issue, I am also facing it.

 thanks for help

 -ashutosh
 On Thursday, February 3, 2011 11:59:54 AM UTC+5:30, kavitha wrote:

 Hi All,

 In my project I am playing video with VideoView and when incoming call is 
 there,I pause the video.

 But later it takes long time to resume playback.But it resumes to correct 
 point.

 Sometimes it says Video cannot be played while resuming.

 Is there any other way to handle pause() and resume() of VideoView.

 protected void onPause() {
 super.onPause();
 pos=videoView.getCurrentPosition();
 videoView.pause();
 }

 protected void onResume() {
 super.onResume();
 videoView.seekTo(pos);
 }

 Please help,it is urgent.

 Thanks
 Kavitha



-- 
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: Prevent Installation of armv7 neon compiled app on Non Neon Devices

2012-08-28 Thread Doug
No.  Neon instructions are not part of the ABI specification, which is what 
the device uses to determine which .so to load.  You have to detect that at 
runtime OR you have to make the user make an informed decision about which 
shared library to use (which drastically decreases usability of your app).

Doug

On Wednesday, August 22, 2012 2:06:36 AM UTC-7, B.Arunkumar wrote:

 Hi, 

What about upload to the Google PlayStore? If we compile the app 
 for armv7 neon support, is it that Google PlayStore will automatically 
 restrict the app from being seen on non-neon devices? 

 Thank you, 
 B.Arunkumar 

 On Aug 22, 1:54 pm, B.Arunkumar awsnetworkrecor...@gmail.com 
 wrote: 
  Hi, 
  
   We have an app which is compiled for arm-v7 neon with appropriate 
  definitions in Application.mk and Android.mk. Is there any way to 
  prevent installation  on Non Neon devices with an appropriate message 
  Cannot install. Currently when I install the application by either 
  debug or run mode, the application installs on the device but when 
  opened. it crashes with an 
  ExceptionInInitializer error. 
  
  Thank you, 
  B.Arunkumar 


-- 
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 way to know a view's height and width before it is really shown on screen?

2012-08-10 Thread Doug
I've always wanted to be able to attach an onSizeChanged listener to an 
arbitrary view to make this easy, but that doesn't seem to be in the cards 
for Android.  You have to wrap your arbitrary view inside another custom 
container and have that container pay attention to onSizeChange to be able 
to respond to that arbitrary view's actual size being known.

Doug

On Thursday, August 2, 2012 7:21:25 AM UTC-7, Fang wrote:

 Hi Android Developers,

 As a request of a function in my app, I need to know a view's height and 
 width before it's really shown on screen. 
 Here I want to know whether it is possible? If yes, then how about the 
 performance? Thanks in advance.

 Regards,
 Fang


-- 
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: AnimationDrawable: animation can't be started in onResume

2012-08-06 Thread Doug Heisler
I know this post is old but if you are still having trouble, start your 
AnimationDrawable in the onWindowFocusChanged method.  Good luck:)





On Tuesday, January 27, 2009 10:36:03 AM UTC-5, G. Blake Meike wrote:

 There's already been some discussion of this, in various lists and 
 blogs.  I finally got an AnimationDrawable to work, but I cannot start 
 it from onResume.  I can start it from a timer that onResume starts, 
 or an onClickHandler. 

 I've poked around the source a bit and I can't figure out, 
 specifically, what state the view has to be in, in order for the 
 background AnimationDrawable to start. 

 Can anyone enlighten me? 

 Thanks 
   -blake

-- 
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: Scanning root of SDcard does not work on 4.1

2012-07-31 Thread Doug
In JB, they changed the mount point for external storage to 
/storage/sdcard0.  At least this is the case for the Galaxy Nexus and Nexus 
7.  So if you're not seeing the directory, double check it.  Still, 
/mnt/sdcard should be a symlink to /storage/sdcard0.

I'm noticing that you're taking the file object from 
Environment.getExternalStorageDirectory, then turning that into a string, 
then turning it into a File again.  That's not necessarily wrong, but you 
might want to reconsider that.

Doug

On Wednesday, July 25, 2012 9:43:07 AM UTC-7, Alessandro Pellizzari wrote:

 Hi all, 

 I am having problems scanning my files on the root of the sdcard, but (it 
 appears) only on 4.1. 

 This is my code: 

 public static void scanAll(NotifyScan target) 
 { 
  String source = 
   Environment.getExternalStorageDirectory().getAbsolutePath() 
  ; 

  Log.d(SCANDIR, source); 
   
  scanDir(new File(source)); 
 } 

 private void scanDir(File path) 
 { 
   for ( File f:path.listFiles() ) { 
 Log.d(SCAN, f.getAbsolutePath()); 
   } 
 } 

 I removed error catching for clarity. 
 The output is: 

 SCANDIR /mnt/sdcard 
 SCAN /mnt/sdcard/LOST.DIR 
 SCAN /mnt/sdcard/.android-secure 

 But from the File Explorer in DDMS and from adb shell, I get: 

 # ls -la /mnt/sdcard 
 d- root root  2012-07-16 11:42 .android_secure 
 d---rwxr-x system   sdcard_rw  2012-07-16 11:42 Alarms 
 d---rwxr-x system   sdcard_rw  2012-07-16 17:06 MyDirectory 
 d---rwxr-x system   sdcard_rw  2012-07-16 11:42 DCIM 
 d---rwxr-x system   sdcard_rw  2012-07-16 11:42 Download 
 d---rwxr-x system   sdcard_rw  2012-07-16 11:42 LOST.DIR 
 d---rwxr-x system   sdcard_rw  2012-07-16 11:42 Movies 
 d---rwxr-x system   sdcard_rw  2012-07-16 11:42 Music 
 d---rwxr-x system   sdcard_rw  2012-07-16 11:42 Notifications 
 d---rwxr-x system   sdcard_rw  2012-07-16 11:42 Pictures 
 d---rwxr-x system   sdcard_rw  2012-07-16 11:42 Podcasts 
 d---rwxr-x system   sdcard_rw  2012-07-16 11:42 Ringtones 

 I need to scan every directory on the sdcard and find a certain type of 
 file. It all worked fine in 2.2 and 2.3. 

 What can I do? 

 Thank you very much. 

 Bye. 




-- 
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: Jelly Bean conversational TTS?

2012-07-27 Thread Doug
I find that JB's TTS is most definitely more natural and overall much 
better.  You might want to find a way to listen to it next to ICS if you 
have two devices and see if you can spot the differences.

Doug

On Saturday, July 21, 2012 8:06:34 PM UTC-7, Josh Burton wrote:

 Hi,

 The whats new in Jelly Bean page (http://www.android.com/about/jelly-bean/) 
 states Jelly Bean introduces a new conversational text-to-speech voice 
 in US English, available as both a network engine and an embedded engine 
 via the TTS API.

 I get the conversation voice in Google Now, but doing Listen to example 
 in the Android voice settings, and using the Google TTS engine in my own 
 apps just gives me the same voice as in ICS.

 How do we access the new Conversational TTS engine?

 Thanks
 Josh


-- 
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: WebView / JavaScriptInterface / String []

2012-07-16 Thread Doug
If you need to return something more complex, you could always generate a 
serialized JSON data structure from JS using your favorite library, return 
it as a string, and then parse the results using Android's JSONObject.

Doug

On Friday, July 13, 2012 6:46:57 AM UTC-7, Pent wrote:

 I thought that might turn out to be necessary, thanks for confirming. 

 Pent

-- 
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: adk 2012 / usb accessory not connecting

2012-07-14 Thread Doug
Joe,

Well, the first thing that irked me was the fact that the board needs a USB 
driver installed, or OSX won't even recognize the board's presence.  This 
was documented nowhere.  I had to hunt it down myself.

No problems with Java here.  The IDE launches fine and I can load source 
files into it.  It just couldn't compile the clock sample out of the box.  
It could never find the first ADK include.  It's been a while, so I don't 
remember those details off the top of my head.  I did have the board 
selected in the menu, but I can't imagine that would make much of a 
difference because the IDE is special for that board.  On the ADK web site 
there is installation step which made no sense to me:

Copy the adk-source-download/adk2012/board/library/ADK2 directory and its 
contents into your sketchbook/libraries/ directory, so that you create a 
sketchbook/libraries/ADK2 directory.

I didn't see anything at all about a sketchbook/libraries directory in the 
real world.  I'm assuming this step was meant to get the ADK libs into a 
place where they will be used by the clock demo or whatever program you're 
writing.  I tried to make up a bunch of possible locations to put these 
files, but no dice.  Maybe they are assuming the reader has prior Arduino 
experience, which I do not.  I was eventually able to get the clock demo to 
compile, but after deployment it locked up the hardware.  I think it wasn't 
actually building the ADK libs with the sample code.

So I switched to the command line tools.  On the command line (using the 
git source repo), when trying to build and deploy it told me I needed 
bossac and gave me a url to find it.  So I went and got it, but the OSX 
exe never once recognized the board.  The bossac exe that comes with the 
IDE does work, however, so I wedged that one into the command line build 
process.  The command line build still had troubles finding the ADK headers 
and sourced needed to build, so I had to copy all those manually into the 
clock demo source tree, then I was finally able to build and deploy.

I'm on OSX Lion on a Mac Mini if that makes any difference.

Doug

On Tuesday, July 10, 2012 12:07:00 PM UTC-7, Joe wrote:

 Hey Doug,

 What problems did you run into using the Mac IDE for the ADK2? I just 
 finished installing the ADK IDE and managed to upload the clock sketch. I'm 
 using a Mac Air with OS X v10.6.8.

 Couple of things I found that were a little tricky:

1. For some reason, my Mac's Java installation got hosed recently and 
I had to update to Java 1.6.0_33. After the update my Arduino IDEs (along 
with the ADK 2012 IDE) started working again. Prior to that update, I 
couldn't even get the IDE to run, error: No compatible version of Java 
1.5*
2. Make sure to you plug into the Computer micro USB port (not the 
Phone port)
3. Choose the correct serial port in the IDE, *Tools  Serial Port* (my 
Mac Air gave me 6 options) the correct port was 
 /dev/tty.usbserial-XXX
4. Choose the board *Tools  Board  Google ADK2*, otherwise the 
sketch won't even compile.


 On Wednesday, July 4, 2012 11:39:29 PM UTC-7, Doug wrote:

 This isn't the right place for ADK discussion, but as far as I can tell, 
 there is no place set aside for it!

 I killed a lot of today trying to get the 2012 ADK to work and was mostly 
 frustrated.  I'm on a Mac and I found the IDE installation instructions 
 very much do not work and I could not manipulate it into building and 
 flashing a working image at all.

 On the command line, I had to jump through hurdles to get the clock demo 
 to build and deploy.  In the end, I could not get recommended bossac 
 downloaded from sourceforge to work at all.  Eventually I had to bypass the 
 given scripts and reached into the Mac IDE app package to use its bossac to 
 deploy a working image.

 All things considered, I'm very disappointed in the usability of the 
 tools that were provided for the 2012 ADK (at least for macosx) and I wish 
 I knew where to go to remedy this.  Otherwise I pretty much give up now.

 Doug

 On Saturday, June 30, 2012 12:28:31 PM UTC-7, michael wrote:

 Testing the new adk2012 and having a few issues. I have  uploaded the 
 usbaccessory sketch, and installed the adk2012 app to the nexus 7. Then I 
 connect the adk  nexus with usb, expecting the adk2012 app to be 
 recognized as an appropriate usbaccessory, but it doesn't and nexus reports 

 Connected as a media device
 USB debugging connected
 Connected to a USB accessory

 Another question, how can I run adb from my android device while it is 
 simultaneously connected to my arduino kit? I was optimistic that it would 
 channel through the arduino and proxy to my pc, but that clearly isn't 
 happening :) ... ADB over bluetooth?

 Thanks,
 Michael




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

[android-developers] Re: MediaPlayer.isPlaying() question

2012-07-13 Thread Doug
If you think the system is stopping your audio temporarily and you need to 
know about that, you probably instead want to pay attention to the callback 
defined in AudioManager.OnAudioFocusChangeListener.

Doug

On Sunday, March 13, 2011 12:24:04 PM UTC-7, Ken H wrote:

 What I'm really asking is for a way to test if the MediaPlayer was 
 paused. I think my app is being paused by the OS for maybe a 
 notification or something. It drives me up the wall when it 
 just...stops. 

 On Mar 13, 11:25 am, Ken H hunt1...@gmail.com wrote: 
  Will android.media.MediaPlayer.isPlaying() return true if the 
  MediaPlayer is paused? 
  
  Ken

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

[android-developers] Re: how to replace with in android or java ?

2012-07-11 Thread Doug
What is the context for needing to do this?

Doug

On Wednesday, July 4, 2012 2:32:09 AM UTC-7, hari2012 wrote:

 hi
 I am working on a project.I have stuck in a problem so please help me asap.
 how to replace  with  in android or java ?
 how to replace two double quotes with single double quotes  in android or 
 java ?

 Thanks in advance,
 regards, 
 hari 


-- 
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: Method for passing information between Fragments

2012-07-08 Thread Doug
This pattern is documented.  Use the host activity to pass messages between 
fragments as needed.

http://developer.android.com/guide/components/fragments.html

Creating event callbacks to the activity

Doug


On Friday, June 29, 2012 12:55:44 PM UTC-7, EpsilonOrion wrote:

 I currently have two fragments setup on the same landscape screen.  On the 
 left is a Map Fragment, while on the right is a List Fragment.  There is a 
 MainActivity that creates the Fragments.  Each Fragment has its own 
 Fragment class and Activity Class.  I am looking at the best method to 
 allow the ArrayList of GeoPoints created from my ItemizedOverlay to 
 populate the ListFragment by passing the list to the ListFragment when 
 points are created.  Then, when a person clicks one of the points in the 
 ListFragment, it sends back a message to the MapFragment that pops up an 
 information bubble for the waypoint in question.

 Basically, I am looking for the best method to pass this waypoint list 
 (and a return point chosen) message between MapFragment and ListFragment.  
 If it would be better to have a third fragment that sits in the background 
 to hold this information, I would be fine with that since in the future 
 these points will be sent off to another phone.

 I am sorry if this question has already been asked, but I have not been 
 able to find a simple answer.  If you have a reference, I would be happy to 
 look at that.  Thanks for the 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: Sample for new MediaCodec API (available in Android 4.1)

2012-07-08 Thread Doug
There was a talk on this at Google I/O.  It's probably your best bet right 
now.

https://developers.google.com/events/io/sessions/gooio2012/117/

Doug

On Sunday, July 1, 2012 4:39:16 PM UTC-7, JohnOR wrote:

 Hi,

 I just installed Android 4.1 (Jelly Bean) on to Nexus here (using ROM from 
 http://forum.xda-developers.com/showthread.php?t=1737849) and wanted to 
 try out the new MediaCodec APIs.  Are there sample apps right now that use 
 this?  I've downloaded new SDK but don't see any related samples there.

 Thanks,
 John



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

[android-developers] Re: activity looses ArrayList items

2012-07-08 Thread Doug
What you really need to do is stop the thing that's updating your list 
before serializing it, then restart it from the point where it left off 
after deserializing it.  Or find another way of coordinating this 
background work you're doing.

Also, you shouldn't be calling restoreRecents in both onCreate and 
onRestoreInstanceState.  Pick one or the other.

Doug

On Thursday, July 5, 2012 1:35:07 PM UTC-7, alex b wrote:

 I saw the notice about the syncronization of the Vector type, but it 
 didn't help me find a solution to the problem.  What I believe i need to do 
 is...
  
 lock the ArrayList, Vector whatever
 update the ArrayList
 unlock the ArrayList
  
 but I don't know how to accomplish this.

  

 On Tuesday, July 3, 2012 1:36:58 PM UTC-7, RichardC wrote:

 I don't think Vector is thread safe in the way you expect did you read: 

 *This class is equivalent to 
 ArrayListhttp://developer.android.com/reference/java/util/ArrayList.html 
 with 
 synchronized operations. This has a performance cost, and the 
 synchronization is not necessarily meaningful to your application: 
 synchronizing each call to get, for example, is not equivalent to 
 synchronizing on the list and iterating over it (which is probably what you 
 intended). If you do need very highly concurrent access, you should also 
 consider 
 CopyOnWriteArrayListhttp://developer.android.com/reference/java/util/concurrent/CopyOnWriteArrayList.html
 . 
 *
 http://developer.android.com/reference/java/util/Vector.html 

 The implication of the above is that your Vector change be changed from 
 another thread whilst you are trying to serialize it.


 On Monday, July 2, 2012 8:52:46 PM UTC+1, alex b wrote: 

 I have an activity that contains a private Vectormyobject, thread safe 
 version of ArrayList.  The activity adds items to the ArrayList, and in 
 onSaveInstanceState() I save the data (see code below).  The problem is 
 that it looses items and it seems to have after the GC runs.  So what am I 
 missing?


 private static RecentItems _lstRecent;
 
 @Override
 public void onCreate(Bundle savedInstanceState) {
 
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main);
 
  restoreRecents(savedInstanceState);
 }

 @Override
 protected void onSaveInstanceState(Bundle outState){
 super.onSaveInstanceState(outState);
 
 String s=serializeIt(_lstRecent);
 bundle.putString(lstRecent, s);
 }
 
 @Override
 protected void onRestoreInstanceState(Bundle outState){
 super.onSaveInstanceState(outState);
 
 this.restoreRecents(outState);
 }

 private void restoreRecents(Bundle bundle){
  if (bundle!=null){
  String s = bundle.getString(lstRecent);
 _lstRecent=deserializeIt(s);
 }
  
 if (_lstRecent ==null)
 _lstRecent=new RecentItems();//unt

 }



-- 
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] Separate design based on resolution. Android 2.3

2012-07-08 Thread Doug
Except in some cases (e.g. with that goofy Galaxy Note device).  To quote 
the guide:

*Note:* These minimum screen sizes were not as well defined prior to 
Android 3.0, so you may encounter some devices that are mis-classified 
between normal and large. These are also based on the physical resolution 
of the screen, so may vary across devices—for example a 1024x720 tablet 
with a system bar actually has a bit less space available to the 
application due to it being used by the system bar.

Hopefully they will get things worked out with the upgrade to ICS.

Doug

On Tuesday, July 3, 2012 12:43:17 AM UTC-7, Dianne Hackborn wrote:

 Don't do it based on resolution.  Period.  Do it in dp units.

 On Sun, Jun 24, 2012 at 5:28 AM, Dmitriy F midnight@gmail.com wrote:

 I'm implementing an application which must support multiple screens and 
 provide devices with different layout designs. My task claims that layout 
 design separation must be based on device resolution: for those devices 
 with  1024x800 resolution use design a and for = 1024x800 - design b. 
 I need to say that a and b differ not only in structure(listviews vs. 
 gridviews) but also in resources they incorporate such as images. For 
 instance, splash screens look completely different.

 I've been looking into multiple screens 
 guidehttp://developer.android.com/guide/practices/screens_support.htmland, 
 indeed, it says that a developer shouldn't base separation of design 
 on resolution, but what if I have to ?
 At first, I was hoping that size-based separation is the same as 
 resolution but it seems that it's not: there're handsets with high 
 resolution and tablets with low.

 At this point I can only figure out resolution and use a layout for 
 either of those designs. In each of those layouts I'd like to make 
 references to appropriate design elements(images) like this:

 /main_480x800.xml
 ImageView
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:src=@drawable/IMAGE_480x800 /

  /main_HIGH_480x800.xml
 ImageView
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:src=@drawable/IMAGE_480x800 /

 I hope there's a better way of implementing it - please, give me your 
 suggestions.

 Best regards,
 Dmitriy F. midnight@gmail.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




 -- 
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to 
 provide private support, and so won't reply to such e-mails.  All such 
 questions should be posted on public forums, where I and others can see and 
 answer them.

 

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

[android-developers] Re: MediaPlayer.setNextMediaPlayer

2012-07-08 Thread Doug


On Tuesday, July 3, 2012 2:42:57 PM UTC-7, b0b wrote:

 Related to setNextMediaPlayer it would great to have more info such as:

 - for which codecs will it handle gapless ? Are there restrictions ?


Can't imagine there would be a problem with codecs.  The issue is that you 
want a continuous stream of PCM data, going to audio out, not where the 
(decoded) PCM is coming from.
 

 -does it work with http URIs passed to setDataSource() ?


If the source prepares in time, I imagine so.

Doug

-- 
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] Can't get AVD to run my noddy app!

2012-07-07 Thread Doug Ponsford
Ok, I waited for about 10 minutes the first time around - I would have 
thought that would be long enough?
 
I have to reinstall it again anyway, so I'll try Java 1.6.  I'll also go 
for Eclipse Helios and have a go with that.
 
Thanks.
 

On Tuesday, 3 July 2012 00:23:42 UTC+1, TreKing wrote:

 On Wed, Jun 27, 2012 at 11:29 AM, Doug Ponsford wrote:

 Eclipse says that my app is loding, but it never runs.  All I get
 is the simulator window with ANDROID on the screen and the buttons
 on the righ-hand side.


 Is this the first time you've set up the Emulator? It's slow as mol-asses, 
 particularly the first time around. You might just have to wait it out. 


 I also have Java 1.7.


 You probably want 1.6.


 -
 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] Re: adk 2012 / usb accessory not connecting

2012-07-05 Thread Doug
This isn't the right place for ADK discussion, but as far as I can tell, 
there is no place set aside for it!

I killed a lot of today trying to get the 2012 ADK to work and was mostly 
frustrated.  I'm on a Mac and I found the IDE installation instructions 
very much do not work and I could not manipulate it into building and 
flashing a working image at all.

On the command line, I had to jump through hurdles to get the clock demo to 
build and deploy.  In the end, I could not get recommended bossac 
downloaded from sourceforge to work at all.  Eventually I had to bypass the 
given scripts and reached into the Mac IDE app package to use its bossac to 
deploy a working image.

All things considered, I'm very disappointed in the usability of the tools 
that were provided for the 2012 ADK (at least for macosx) and I wish I knew 
where to go to remedy this.  Otherwise I pretty much give up now.

Doug

On Saturday, June 30, 2012 12:28:31 PM UTC-7, michael wrote:

 Testing the new adk2012 and having a few issues. I have  uploaded the 
 usbaccessory sketch, and installed the adk2012 app to the nexus 7. Then I 
 connect the adk  nexus with usb, expecting the adk2012 app to be 
 recognized as an appropriate usbaccessory, but it doesn't and nexus reports 

 Connected as a media device
 USB debugging connected
 Connected to a USB accessory

 Another question, how can I run adb from my android device while it is 
 simultaneously connected to my arduino kit? I was optimistic that it would 
 channel through the arduino and proxy to my pc, but that clearly isn't 
 happening :) ... ADB over bluetooth?

 Thanks,
 Michael




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

[android-developers] Re: how to share the audio played on android device to multiple audio devices

2012-07-04 Thread Doug
An app can't know exactly what is being played on the device in a general 
sense, unless it is the app playing the audio, and it is generating the raw 
PCM to send to an AudioTrack.

Doug

On Tuesday, June 26, 2012 4:09:04 AM UTC-7, kuldeep wrote:

 I am planning to implement a simple application that will share the 
 current audio being played on android device, to be played on another 
 android device. It will be a great help if anyone can tell me how to 
 copy the audio out buffer so that I can share same audio track that is 
 running on the first Android device. Please reply to me with all your 
 suggestions and implementation details

-- 
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] Can't get AVD to run my noddy app!

2012-06-28 Thread Doug Ponsford
Hi, I'm a newbie that needs some help on getting the AVD running with
my app.  I've been developing C code for decades, but I have to admit
the Eclipse/AVD setup has me stumped!  I'm following the 'HelloWorld'
tutorials on this website (and some others) and everything seems to be
working OK, up to the point where I try to run it on the simulator.
I'm not getting any warnings, the Eclipse build/run output window says
that everything is installed OK and the AVD seems to startup and run
OK.  Eclipse says that my app is loding, but it never runs.  All I get
is the simulator window with ANDROID on the screen and the buttons
on the righ-hand side.

I've got Eclipse Indigo and r18 of the Android PlugIn (I tried to
install Helios, but the Eclipse website directed me to Indigo!).  Is
Indigo OK for running the simulator, or do I specifically need
Helios?  I also have Java 1.7.

The API level I have installed is Level 15 (v4.xxx of Android, I
think).  Don't know if I need a lower version to get my tutorial app
to run, but level 15 is the only one I can select when setting up a
device in the AVD manager.

I've been trying to get this going for days, trying all sorts of
switches and buttons, but to no avail.  Before I start unistalling
everything and reinstalling, is there anything I might be missing?
Something that always trips up new starters maybe?  Or do I need ot go
back to scratch?

Any help would be much 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: Compil assembly code for ARM and X86

2012-06-21 Thread Doug
This is an NDK question, so I suggest taking it to the NDK group, not here.

groups.google.com/group/android-ndk

Doug

On Friday, June 15, 2012 2:26:03 AM UTC-7, WebShaker wrote:

 Hi. 

 I've just bought an Intel Android smartphone ! 

 I've change My Application.mk to add a plateforme 

 APP_ABI := armeabi armeabi-v7a x86 

 And that works for Java a C code source. 

 But I have a assembly file too. 
 For ARM I used to compile it whit some options 

 Here is my Android.mk 

 LOCAL_MODULE := engine 
 LOCAL_ARM_MODE := arm 
 LOCAL_CFLAGS := -mfpu=neon -march=armv6t2 -O9 
 LOCAL_SRC_FILES := engine-arm.s 
 LOCAL_LDLIBS := -lm -llog -ljnigraphics 
 LOCAL_STATIC_LIBRARIES := cpufeatures 

 Well now My problem is that I have another assembly file for the x86 
 called engine-x68.s 

 What I'd like to do is compiling it with some gcc options 
 -msse2 -m32 -masm=intel 

 So My Android.mk file should be something like 

 LOCAL_MODULE := engine 
 LOCAL_CFLAGS := -msse2 -m32 -masm=intel 
 LOCAL_SRC_FILES := engine-x86.s 
 LOCAL_LDLIBS := -lm -llog -ljnigraphics 
 LOCAL_STATIC_LIBRARIES := cpufeatures 

 Finally my question is. 

 How Can I compile engine-arm.s with the first Android.mk param and 
 compile engine-x68.s with the second one ? 
 My goal is to have only one module (engine) and let Android loading 
 the correct library !

-- 
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: Landscape/Portrait and more... an advanced question

2012-06-20 Thread Doug
No.  Orientation is an all or none proposition for all activities that may 
be showing at any given moment.

The best thing to do would be to make all your activities work in all 
situations that you anticipate and not to lock orientation of anything 
except, perhaps, if you are writing a game that just needs a single 
activity to host the game display.

Doug

On Wednesday, June 13, 2012 2:18:10 AM UTC-7, Mark Cz wrote:


 Is it possible to show a *Translucent * activity is in portrait while the 
 activity below is in landscape ?


-- 
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 do I save a complete webpage displayed in Android's WebView?

2012-06-20 Thread Doug
I don't think you can do this with documented public APIs.  I wouldn't go 
reaching into that cache folder unless you have a very clear understanding 
of how that works in all versions of Android that you need to work with.

Doug

On Wednesday, June 13, 2012 11:55:53 AM UTC-7, VP wrote:

 I am developing an Android application in which I have a WebView. I want 
 to save the entire webpage loaded in this webview (Html + all resources + 
 images + icons etc) into a folder and zip it and upload it to a server. 

 If you use WebView's 
 saveWebArchivehttp://developer.android.com/reference/android/webkit/WebView.html#saveWebArchive%28java.lang.String%29,
  
 then it is saved in archive format. How do I get the Html and images back 
 from this archive? Is there any documentation for the format of this 
 archive? 

 If I use addJavaScriptInterface to get the html as described 
 herehttp://lexandera.com/2009/01/extracting-html-from-a-webview/, 
 I still have to copy the images and other resources from the webview cache 
 dir (/data/data/your app package/cache/webviewCache/). However I did not 
 find webview cache dir (/data/data/your app package/cache/webviewCache/) in 
 Icecream Sandwich. 

 Is there a way to save the entire webpage displayed in webview along with 
 resources in Android? Can somebody please help. I have to ship this feature 
 ASAP.

 Thanks 


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

Re: [android-developers] Re: Widget Product Updates

2012-06-04 Thread Doug Gordon
Good info. This actually explains some of the buggy behavior I've seen, 
not on my own apps, but on various others on my own devices. Especially 
when I apply an update and then the screen widget stops working with an 
App not installed error popping up.

On Sunday, June 3, 2012 10:57:37 PM UTC-4, Dianne Hackborn wrote:

 This is an overview I wrote last year on the things you shouldn't change 
 in your app if you want updates to go smoothly:  
 http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html

 On Sun, Jun 3, 2012 at 4:09 AM, Kostya Vasilyev kmans...@gmail.comwrote:


 03.06.2012 14:22, David Ross написал:

  Sadly, this does not work at all well. Just as when you have a widget
 and you uninstall the app you get the horrid Problem Loading Widget
 message, the same thing happens when the user accepts the update from
 the Play site.


 Never seen this with my own widgets, or other installed widgets on any of 
 my phones.

 Now, if the updated package uses a different class name for the same 
 widgets, the home screen won't know this, and the user will get the message 
 you describe.

 So, pick those class names carefully, and don't change them :)

 Besides, package updates happen all the time during development 
 (run/debug), and they doesn't cause existing widgets to go sour.

 In fact, the launcher will update all of them just after the installation 
 is complete to ensure consistency with new code and assets.


  Also watch out for irritating things like ghost widgets on lower API
 levels (1.6) when unexpected things happen like there's not enough
 home screen space for your widget. I keep my own track of the widgets
 so I can detect and ignore ghost widgets.


 I've seen ghost widget ids on my Galaxy Nexus with 4.0.4, so don't throw 
 that code away just yet :)


 -- 
 Kostya Vasilyev


 -- 
 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 android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en




 -- 
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to 
 provide private support, and so won't reply to such e-mails.  All such 
 questions should be posted on public forums, where I and others can see and 
 answer them.



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

[android-developers] Widget Product Updates

2012-06-02 Thread Doug Gordon
I'll shortly be releasing my first widget product and am wondering if 
there are any restrictions as to how the user updates a widget when a 
new version is posted. I've noticed that if you use the App Manager to 
delete a widget that's in use without removing it from the home screens, 
an error message ends up being displayed in that location on the screen 
(which you then have to remove in the standard way).


But if an updated version is installed over the existing version, is the 
updated widget now displayed as expected on the home screen? Or would 
the user be forced to remove the existing instances and add back the 
updated widget?


Doug Gordon
GHCS Software

--
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: Access denied error while trying to install new API

2012-05-03 Thread Doug Davis
you guys rule thank you

On Wednesday, December 14, 2011 4:26:17 PM UTC-5, Uday (Dave) wrote:

 Hi, I have installed the android sdk 16 on my Windows7 machine I have
 installed the Android2.1 API initially without any glitch. But then
 again when I try to install the other APIs using the SDK manager, it
 gives me:


 Downloading SDK Platform Android 2.3.3, API 10, revision 2

 File not found: C:\Program Files (x86)\Android\android-sdk\temp
 \android-2.3.3_r02-linux.zip (Access is denied)

 Downloading Samples for SDK API 10, revision 1

 File not found: C:\Program Files (x86)\Android\android-sdk\temp
 \samples-2.3.3_r01-linux.zip (Access is denied)

 Skipping 'Google APIs by Google Inc., Android API 10, revision 2'; it
 depends on 'SDK Platform Android 2.3.3, API 10, revision 2' which was
 not installed.

 Done. Nothing was installed

 Thanks,

 Dave



-- 
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: Stereo AudioRecord

2012-05-03 Thread Doug
Are there two microphones on the Galaxy Nexus, one for each of the left and 
right channels?

I'm guessing the answer will be no.  I don't think there are any phones 
that have two microphones for stereo recording.

Doug

On Tuesday, April 24, 2012 2:23:58 AM UTC-7, Akshay Malhotra wrote:

 I want to capture Stereo signals on my Galaxy Nexus Prime and Galaxy 
 Note phones usibg Audio Record. 
 But when do this the data captured by both left and right microphones 
 is same(bit exact). 
 Is it possible to record audio in STEREO mode on Samasung phones? 
 I am able to do this on motorola and sony phones but not on samsung.

-- 
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: Audio / Performance Issues on ICS / Android 4

2012-05-03 Thread Doug
Try doing the AudioTrack write in another thread that doesn't have to wait 
on the audio processing.  I'm thinking producer/consumer kind of 
relationship.  That way, the producer can be making more audio for the 
consumer to write without having to wait on the write to complete.  I've 
solved problems this way before when having to deal with larger buffers of 
audio.

Doug

On Friday, April 27, 2012 2:25:14 AM UTC-7, piezo wrote:

 Hello 


 I have a music (sequencer/synth) app in Android Market. One of its 
 strengths is that it uses very little resources and plays smoothly 
 even on the oldest and cheapest devices and only requires Android 
 version 1.6. 

 However, since the arrival of ICS, I get more and more complaints 
 about stuttering playback and a sluggish interface, mainly on Galaxy 
 Nexus. The app hasn't changed and still works fine on earlier versions 
 of Android. 

 I wonder what may have changed. 

 My app does the audio processing in native code and I suspect the way 
 data are passed between java and native might be the problem (I still 
 use AudioTrack to maintain 1.6 compatibility and because it always 
 worked fine): 

 public class PlayThread extends Thread 
 { 
 public void run() 
 { 
 ByteBuffer byteBuffer = 
 ByteBuffer.allocateDirect(minSize); 
 byte[] byteArray = new byte[minSize]; 

  
 android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);
  

 int minSize =AudioTrack.getMinBufferSize( 44100, 
 AudioFormat.CHANNEL_CONFIGURATION_STEREO, 
 AudioFormat.ENCODING_PCM_16BIT ); 
   myTrack = new AudioTrack( AudioManager.STREAM_MUSIC, 
 44100, AudioFormat.CHANNEL_CONFIGURATION_STEREO, 
 AudioFormat.ENCODING_PCM_16BIT, 
 minSize, AudioTrack.MODE_STREAM); 

 myTrack.play(); 

 while(1) 
 { 
 byteBuffer.position(0); 
 processNativeAudio(byteBuffer, minSize); 
 byteBuffer.position(0); 
 byteBuffer.get(byteArray, 0, minSize); 
 myTrack.write( puff, 0, minSize ); 
 } 
 } 
 } 

 In the main activity, a new PlayThread is created on startup. The 
 native function looks like this: 

 void Java_com_myapp_ processNativeAudio( JNIEnv *  env, jobject this, 
 jobject buffer , jint buflng) 
 { 
 jbyte *jbuffer = (*env)-GetDirectBufferAddress(env, buffer); 
 short *shortBuffer= (short*)(jbuffer); 

 // processing audio here and writing to shortBuffer 
 } 


 Anyone has similar problems or even knows a workaround? 

 Thank you.

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

[android-developers] Getting Unable to Instantiate activity; Component ClassNotFound exception

2012-04-18 Thread Doug Gordon
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


[android-developers] Re: Media player no video

2012-03-31 Thread Doug
Does your app have internet permissions to do streaming (required in ICS)?  
Is the video codec supported by your device?

Doug

On Tuesday, March 27, 2012 6:25:56 AM UTC-7, aglasofmilk wrote:

 Hi! I have a problem with playing videos through mediaplayer. I have a 
 sound but no video. I was searching a lot of thread but can't find 
 solve for my problem. Is is something wrong with the code? Or is it 
 something else. Here's the code: 

 public class TestStream1 extends Activity implements Callback{ 
 MediaPlayer mMediaPlayer; 
 String SrcPath = rtsp://184.72.239.149/vod/ 
 mp4:BigBuckBunny_175k.movhttp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov;
  

 private SurfaceView mPreview; 
 private SurfaceHolder holder; 
 @Override 
 public void onCreate(Bundle savedInstanceState) { 
 super.onCreate(savedInstanceState); 
 setContentView(R.layout.main); 

 mPreview = (SurfaceView) findViewById(R.id.myvideoview); 
holder = mPreview.getHolder(); 
holder.addCallback(TestStream1.this); 
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); 

holder.setFixedSize(400,300); 
mMediaPlayer = new MediaPlayer(); 
try{ 
mMediaPlayer.setDataSource(SrcPath); 
mMediaPlayer.setDisplay(holder); 
mMediaPlayer.prepare(); 
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 
mMediaPlayer.start(); 

}catch(Exception e){ 
Toast .makeText( TestStream1.this, Fail, 
 Toast.LENGTH_LONG).show(); 
} 

 } 
 }

-- 
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: use of audio streams

2012-03-31 Thread Doug
You can use STREAM_MUSIC and also request audio focus to try to gain 
priority.

Doug

On Tuesday, March 27, 2012 8:09:26 AM UTC-7, RedBullet wrote:

 I am building an app that will do TTS to read turn by turn directions for 
 navigation.

 When I am using a bluetooth headset I turn on SCO and use the 
 STREAM_VOICE_CALLhttp://developer.android.com/reference/android/media/AudioManager.html#STREAM_VOICE_CALL
  stream.

 My question is, when I am NOT using bluetooth and just want to use the 
 phone (optionally speaker) which stream do I use? 
 STREAM_MUSIChttp://developer.android.com/reference/android/media/AudioManager.html#STREAM_MUSIC
  or 
 something else?


-- 
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] R17: a library project cannot depend on another library project?

2012-03-26 Thread Doug
How does one downgrade to r16, or any non-latest version of the SDK at any 
time?

Doug

On Monday, March 26, 2012 6:35:18 AM UTC-7, Nikolay Elenkov wrote:

 The best thing you can do is update your projects, or have them

 updated. If you can't do it right now, use ADT16 for the time being.



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

[android-developers] Re: How to read Peoples address in android 4.0 platform

2012-03-25 Thread Doug
It is not hard to search for.

http://developer.android.com/resources/articles/contacts.html

Doug

On Thursday, March 22, 2012 2:29:33 AM UTC-7, Sandeep Nemuri wrote:

 i am not able to find any code for reading peoples address from address 
 book in android 4.0 platform . can any 1 help me ?? 

-- 
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: Removing an item from ListView

2012-03-21 Thread Doug
You can do this the same way you would do anything that changes the data 
displayed in a ListView.  Make the data change in the adapter that's hooked 
up to the ListView, then call notifyDataSetChanged on the adapter.  That 
will cause the ListView to refresh with the new data in the adapter.

Doug

On Tuesday, March 20, 2012 7:34:00 AM UTC-7, radhakrishna wrote:

 @seshu 

 You mean updating onListItemClick method in 
 TestListItemsView1Activity : 
 -
  

 protected void onListItemClick(ListView l, View v, int position, 
 long id) { 
 super.onListItemClick(l, v, position, id); 
 Toast.makeText(this, Click- + String.valueOf(position), 
 Toast.LENGTH_SHORT).show(); 
  dataValues..remove(position); 
 } 
 -
  


 This does not work for me, I need to click remove button to remove 
 listrow. 

 My ListView contains [TextView and delete Button], I need to delete 
 list row, when I click on Delete button, When I click On Delete button 
 it will not enter into onListItemClick method under 
 TestListItemsView1Activity class , it will enter only when I select 
 TextView (Text). 

 Onlick method for delete button located in EfficientAdapter class. 

 On Mar 20, 2:20 pm, Seshu s.seshu...@gmail.com wrote: 
  dataValues..remove(position);  will deletes the entire row only... 
  
  On Mar 20, 6:58 pm, radhakrishna radhakrishna.kotako...@gmail.com 
  wrote: 
  
  
  
  
  
  
  
   Thank  you for your response Seshu, But I would like to delete list 
   row, when I click on delete button from List view. 
  
   On Mar 20, 1:12 pm, Seshu s.seshu...@gmail.com wrote: 
  
Hi radhakrishna, 
if u want to delete the list row in the list view. 
  
protected void onListItemClick(ListView l, View v, int position, 
long id) { 
super.onListItemClick(l, v, position, id); 
Toast.makeText(this, Click- + String.valueOf(position), 
Toast.LENGTH_SHORT).show(); 
  
 dataValues..remove(position); 
  
} 
  
Thanks and Regards, 
S.Seshu 
  
On Mar 20, 2:41 am, radhakrishna radhakrishna.kotako...@gmail.com 
wrote: 
  
 Hi All, 
  
 I am trying to remove an item from  listview, 
 My Listview contains Text and Delete button in each row, 
 when I click on delete button its removing Last row from List 
 view, 
 not the actual one which I clicked 
  
 Here is the Activity Class: 
 
 --- 
 -- 
  
 public class TestListItemsView1Activity extends ListActivity { 
 /** Called when the activity is first created. */ 
  
 private EfficientAdapter efficientAdapter; 
 private static String[] data = new String[] { BBC, 
 Yahoo, CNN, 
 Eenadu, Hindu }; 
 private static ListString dataValues = 
 Arrays.asList(data); 
  
 @Override 
 public void onCreate(Bundle savedInstanceState) { 
 super.onCreate(savedInstanceState); 
  
 requestWindowFeature(Window.FEATURE_NO_TITLE); 
 setContentView(R.layout.main); 
 efficientAdapter = new EfficientAdapter(this, dataValues); 
  
 setListAdapter(efficientAdapter); 
 } 
  
 @Override 
 protected void onListItemClick(ListView l, View v, int 
 position, 
 long id) { 
 super.onListItemClick(l, v, position, id); 
 Toast.makeText(this, Click- + String.valueOf(position), 
 Toast.LENGTH_SHORT).show(); 
 } 
  
 Here is the Adapter class 
 
 --- 
 -- 
  
 public class EfficientAdapter extends BaseAdapter implements 
 Filterable{ 
  
 private LayoutInflater mInflater; 
 private Context context; 
 final private ListString data= new ArrayListString(); 
 private HashMapString,EfficientAdapter.ViewHolder 
 holders= new 
 HashMapString, EfficientAdapter.ViewHolder(); 
  
 public EfficientAdapter(Context context,ListString data) 
 { 
 //super(context, R.layout.main, values); 
 mInflater = LayoutInflater.from(context); 
 this.context=context; 
 this.data.addAll(data); 
 } 
  
 public View getView(final int position, View convertView, 
 ViewGroup 
 parent) { 
 ViewHolder holder; 
  
 if(convertView == null){ 
 convertView = 
 mInflater.inflate(R.layout.adaptor_content, null); 
  
 holder = new ViewHolder(); 
 holder.textLine = (TextView

[android-developers] Re: Is it possible to open an Audio Recorder by more than one app using OpenSL?

2012-03-21 Thread Doug
I think you would have to get all the components that want to share audio 
recording responsibilities to be coordinated using some other mechanism.

Doug

On Tuesday, March 20, 2012 2:58:41 AM UTC-7, smichak wrote:

 OK - so sharing is impossible. 

 My follow-up is therefore: Is it possible to open the audio input 
 device in a manner that would make it forefit or yield the resource if 
 another application requests it? Again - I am asking this in the 
 context of the OpenSL implementation. I have seen that OpenSL objects 
 are assigned priorities and can be made preemptable - I wonder if 
 that's what I'm looking for. 

 On Mar 20, 9:46 am, Doug beafd...@gmail.com wrote: 
  What do you suppose will happen if 5 processes each ask for audio 
 recording 
  with 5 different combinations of recording frequencies and sample sizes? 
  Is Android obliged to resample audio to those requested parameters for 
 each 
  app?  What about 10 apps?  That's a lot of resampling. 
  
  This is the reason why only one app can record audio at a time. 
  
  Doug 
  
  
  
  
  
  
  
  On Sunday, March 18, 2012 10:14:05 AM UTC-7, smichak wrote: 
  
   Hi, 
  
   I am writing an application that runs as a background service 
   recording and analyzing audio samples. I have noticed that it is 
   impossible to use the SDK's AudioRecord class for accessing the 
   microphone simultaneously by more than one application. I was 
   wondering whether it would be possible to do that using the Native 
   Audio API, i.e. OpenSL ES. Can anyone provide insight on why this may 
   or may not work? 
  
   Micha

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

[android-developers] Re: Is it possible to open an Audio Recorder by more than one app using OpenSL?

2012-03-20 Thread Doug
What do you suppose will happen if 5 processes each ask for audio recording 
with 5 different combinations of recording frequencies and sample sizes?  
Is Android obliged to resample audio to those requested parameters for each 
app?  What about 10 apps?  That's a lot of resampling.

This is the reason why only one app can record audio at a time.

Doug

On Sunday, March 18, 2012 10:14:05 AM UTC-7, smichak wrote:

 Hi, 

 I am writing an application that runs as a background service 
 recording and analyzing audio samples. I have noticed that it is 
 impossible to use the SDK's AudioRecord class for accessing the 
 microphone simultaneously by more than one application. I was 
 wondering whether it would be possible to do that using the Native 
 Audio API, i.e. OpenSL ES. Can anyone provide insight on why this may 
 or may not work? 



 Micha

-- 
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] Same permission defined in multiple applications

2012-03-20 Thread Doug
Dianne, when would you recommend using sharedUserId?  Also, are these 
subtleties documented anywhere?

Doug

On Monday, March 19, 2012 5:57:33 PM UTC-7, Dianne Hackborn wrote:

 I strongly recommend avoiding sharedUserId.  Note that once you publish an 
 app with this, you can never go back.  It will have a lot of subtle 
 repercussions on your app that you may not like -- everything from all of 
 the apps with the same shared user ID being batched together in accounting 
 for battery use, to your processes being killed when one of your apps with 
 the shared user ID is updated.

 On Mon, Mar 19, 2012 at 10:23 AM, Justin Anderson 
 magouyaw...@gmail.comwrote:

 If you want to share things like preferences between the different apps 
 then you will want to make sure that you also give them the same 
 sharedUserId attribute in the manifest:


 http://developer.android.com/guide/topics/manifest/manifest-element.html#uid

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



 On Sun, Mar 18, 2012 at 4:24 PM, Mark Murphy mmur...@commonsware.comwrote:

 On Sun, Mar 18, 2012 at 5:50 PM, Ryan Reeves rreeves...@gmail.com 
 wrote:
  I am developing two applications that will share functionality via 
 their
  activities. I would like to only allow applications signed with the 
 same
  certificate to start these activities.
 
  My plan is to create a custom permission with protection level of 
 signature
  and apply that permission to exported activities in both applications.
  Either application can be installed first, so I will define the 
 permission
  in both application manifests.
 
  Are there problems with defining the same permission in multiple
  applications?  I plan to release both applications on the Android 
 market.

 AFAIK, that should work fine.

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

 _Android Programming Tutorials_ Version 4.1 Available!

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




 -- 
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to 
 provide private support, and so won't reply to such e-mails.  All such 
 questions should be posted on public forums, where I and others can see and 
 answer them.


On Monday, March 19, 2012 5:57:33 PM UTC-7, Dianne Hackborn wrote:

 I strongly recommend avoiding sharedUserId.  Note that once you publish an 
 app with this, you can never go back.  It will have a lot of subtle 
 repercussions on your app that you may not like -- everything from all of 
 the apps with the same shared user ID being batched together in accounting 
 for battery use, to your processes being killed when one of your apps with 
 the shared user ID is updated.

 On Mon, Mar 19, 2012 at 10:23 AM, Justin Anderson 
 magouyaw...@gmail.comwrote:

 If you want to share things like preferences between the different apps 
 then you will want to make sure that you also give them the same 
 sharedUserId attribute in the manifest:


 http://developer.android.com/guide/topics/manifest/manifest-element.html#uid

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



 On Sun, Mar 18, 2012 at 4:24 PM, Mark Murphy mmur...@commonsware.comwrote:

 On Sun, Mar 18, 2012 at 5:50 PM, Ryan Reeves rreeves...@gmail.com 
 wrote:
  I am developing two applications that will share functionality via 
 their
  activities. I would like to only allow applications signed with the 
 same
  certificate to start these activities.
 
  My plan is to create a custom permission with protection level of 
 signature
  and apply that permission to exported activities in both applications.
  Either application can be installed first, so I will define the 
 permission
  in both application manifests.
 
  Are there problems with defining the same permission in multiple
  applications?  I plan to release both applications on the Android 
 market.

 AFAIK, that should work fine.

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

 _Android Programming Tutorials_ Version

[android-developers] Re: Connect MediaRecorder to MediaPlayer

2012-03-17 Thread Doug
Generally speaking, video streams need to be seekable in order to play.  
The exception to this is video streams that were specially constructed to 
be streamable, which I'm pretty sure you will not get out of a 
MediaRecorder.

Doug

On Tuesday, March 13, 2012 2:40:38 PM UTC-7, Jeff wrote:

 I want to test running both the hardware video encoder and decoder 
 simultaneously. To that end I'm trying to figure out how to connect the 
 output of a MediaRecorder as the input to a MediaPlayer. The only way I 
 could figure out to do this was through DatagramSockets connected through 
 the loopback and ParcelFileDescriptors. I'm having some trouble getting 
 this to work though. Is there a better way to hook up a MediaRecorder to a 
 MediaPlayer? Know of any sample code that exists?

 Thanks in advance.


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

[android-developers] Re: Application Recycling

2012-03-17 Thread Doug
In ICS there is a Developer Option called Don't keep activities.  If you 
check it, activities and their fragments will go through a complete cycle 
of create/destroy, which will test their ability to save and restore their 
instance states.  This is the same as if your app will killed and restored 
at each activity transition.

Older devices and emulators might have a Spare Parts app that can toggle a 
similar setting.

Doug

On Wednesday, March 14, 2012 8:51:15 AM UTC-7, Trey wrote:

 I'm trying to test my application's ability to be restored after my 
 phone reclaims it for memory. I'm unable to find a consistent way to 
 reproduce this behavior. 

 My first questions is: 
 What is the official term for this? Application Recycling doesn't 
 seem to help me find any information online. 

 Once I know what it's called I should be able to find some info, and 
 even search these forums accurately and find an answer; but if anyone 
 is willing to point me in the right direction I would appreciate that 
 as well! 

 Thanks, 
 Trey

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

  1   2   3   4   5   6   7   >