Change the management of NSD Listener objects to one which ensures
that each Listener will be used for only one NSD service request at
a time (as the APIs were intended to function). Listeners are now
allocated in a "lazy" on-demand way, rather than having one Listener
of each type allocated at application startup time. When the Register
or Discover button is clicked, any existing Listener request of that
type will be canceled and the Listener discarded (avoiding the need
to wait until the Listener callback has been completed), and a new
Listener will be allocated.
Moves code around in the application-lifecycle callbacks to reflect
the current Android lifecycle. Doing important things like
unregistering NSD services should not be done in the onDestroy()
callback, as there is no guarantee that the app won't be killed
before this callback is invoked. This can lead to "zombie"
NSD registrations in KitKat.
Adds additional lifecycle logging.
Pass 2 - fix typo, clean up trailing whitespace
Pass 3 - fix onStart/onRestart mismatch
Bug: 13512512
Change-Id: Ic164110759204b27d8a14376777b593ebe1865fa
Activity under test was called in setUp instead of each test method.
Now each test method makes a separate call to startActivity() like
mentioned in our documentation.
Change-Id: I41df74cd5dae30e57cb481bb85714e361a9189e8
Signed-off-by: Stephan Linzner <slinzner@google.com>
Testing training sample code for Activity testing. Including
test cases for Instrumentation and Unit Testing of Activities
Uses old test structure with src/ and tests/ folder for
easy import to eclipse. Contains a build.gradle to
easily run it via the new build system from cli. Remapping
of tests/ is done within the build.gradle configuration file
Change-Id: I15f815ad185257a8fa650b3c0f10ba761044379c
Signed-off-by: Stephan Linzner <slinzner@google.com>
* commit 'bc1a645f26a30fd95e68043b608038537b7c798f':
Contacts Provider Training Class - Sample App Initial Commit This is the sample app for the Contacts Provider Android training class. It's a basic master/detail view with a list of contacts in the master and contact name, photo and mailing addresses in the detail. This sample app is backward compatible to API level 7 and also optimized for all screen sizes.
This is the sample app for the Contacts Provider Android training
class. It's a basic master/detail view with a list of contacts in the
master and contact name, photo and mailing addresses in the detail.
This sample app is backward compatible to API level 7 and also
optimized for all screen sizes.
Change-Id: I83fe6beae9fd4c3fe710426b7dd0863e094cbc89
Add a larger number of sample images so it's easier to see the result
of the various bitmap optimizations.
Change-Id: Ieef04a1cd4dc6cf1fa165baa0a6f8d4750b58d71
This adds support for devices running Honeycomb or newer
to use the inBitmap BitmapFactory option when decoding images. The way
it accomplishes this is by adding a second level 'memory cache' using
SoftReferences. When an item is removed from the LruCache it is added
to this SoftReference Set. The next time an image is decoded, the Set
is searched to see if it contains a bitmap that can be re-used.
Change-Id: I8f980160ddc7116731b25e6f3f110c38f207f286
Signed-off-by: Chris Banes <chrisbanes@google.com>
A new sub-class of BitmapDrawable has been created which tracks
when it is being used or cached when running on Gingerbread or
older. A new ImageView subclass has been added to accomplish this,
as well as changes to the LruCache.
Change-Id: I95d3334684703aebb6b09fcd56194cf73e3c2dcf
Signed-off-by: Chris Banes <chrisbanes@google.com>
Background image loading is paused when the GridView is scrolling,
if the activity is destroyed during a scroll the image loading was
not unpaused causing it to remain running indefinitely. This change
makes sure the background image loading is unpaused.
Change-Id: Iad8093fc2af50fcfc1416c5d9089db0c064711cf
When calculating memory cache size, use Runtime.maxMemory() instead
of getMemoryClass() which is a more accurate value of available VM
heap size.
Also bump target and build SDK to 17.
Bug: 7988323
Change-Id: I4b94688b3800d958ffbe03ee9a2a620982483d3d
When computing inSampleSize, calculateInSampleSize() needs to compare
height/width ratios, rather than raw values.
Also updating support library JAR to latest version.
Bug: 7951398
Change-Id: Id15dbcc105bbd2bbf8e03883aeba780da6f807eb
Changes:
-Use updated versions of ImageWorker & ImageCache from I/O 2012 app
-Use copied DiskLruCache from system (rather than custom)
-Use copied AsyncTask from system (to keep behavior consistent)
-Ensure no strict mode violations or lint errors
-Other misc bug fixes
-Move single-use static methods in Utils to corresponding class
Change-Id: If21e045db1e1a80391169f3c9c9258d48345ab6b
This sample code was launched with the Implementing Effective Navigation and
Creating Backward-Compatible UIs training classes, but the source was never
added to AOSP. This retroactively adds the source, unmodified.
Change-Id: If6face5a0548107f7fd273e466b1ced2790f4f3a
The app has a fragment with a list that shows a couple phony
article names and a fragment that displays the phony articles.
They appear side by side on a large screen, but one at a time on smaller screens.
Change-Id: Ic78b772e1c8d1ddbfa6fa3fdb0b54a2363951063
Changing the package name for activity-lifecycle sample from
com.example.android to com.example.android.lifecycle.
Change-Id: I8c17762fde0895408da0b2e1b17b425bcb9e7abb