Game Development Reference
In-Depth Information
Then, for the URL for the irst image:
ImageURL = Picasa_GetDirectImageURL(Images[0],
PHOTO_SIZE_128);
Finally, use the downloader to get the image located at ImageURL .
There's moreā€¦
There are sets of rules on both Flickr and Picasa sites, which discourage massive automated
downloads of full-size images (not more than one per second), and any application we develop
should strictly follow these rules.
One nice thing about the code for this recipe, is that it can be modiied to support the well-
known Yandex.Fotki photo site or other similar photo hosting services, which provide RSS
feeds. We leave it as a do-it-yourself exercise for the reader.
Performing cross-platform multithreading
To continue improving the user experience, we should make long-running tasks asynchronous,
with ine-grained control over their execution. To do so, we implement an abstraction layer on
top of the operating systems' threads.
Getting ready
Android NDK threads are based on POSIX threads. Take a look at the header ile platforms\
android-14\arch-arm\usr\include\pthread.h in your NDK folder.
How to do it...
1.
Let's start with declarations of thread handle types:
#ifndef _WIN32
#include <pthread.h>
typedef pthread_t thread_handle_t;
typedef pthread_t native_thread_handle_t;
#else
#include <windows.h>
typedef uintptr_t thread_handle_t;
typedef uintptr_t native_thread_handle_t;
#endif
 
Search WWH ::




Custom Search