This directory contains a list fo simple sample apps developed with the purpose to test the Prefetching Library and Plugin for Android Studio.
Currently, there is a total of 2 sample apps:
- Weather and News: Consume two REST APIs about the weather and news and display the content
- Yet Another Pokemon List: List informations about the Pokemon world
The library is imported using Gradle flat directory repository,
configured in the sample app module at sample-app/app/libs/aar
.
Go to the test app root directory and run the update script to update the imported version of the library:
sh scripts/update-nappa-library.sh
Alternatively, you can do the following steps to import a new version:
- Go to the Prefetching Library directory
- Build the library
- Via the command line:
- Run the command
./gradlew build
- Run the command
- Via Android Studio
- Open the project in Android Studio
- Open the Gradle tool window
- Double click at
Prefetching-Library > Tasks > build > build
- Via the command line:
- Go to
Prefetching-Library/android_prefetching_lib/build/outputs/aar
- Rename the file
android_prefetching_lib-debug
tonappa-prefetching-library.aar
- Optionally,
create a copy of
android_prefetching_lib-debug
and name itandroid_prefetching_lib-debug-vMAJOR.MINOR.PATCH+BUILD
, replacing the values with the version specified in the library Gradle build file - Replace the existing library file at
sample-app/app/libs/aar
- Open the sample app project in Android Studio
If needed, sync Gradle at File > Sync project with Gradle files
- Open the sample app project in Android Studio
- Open the class finder at
Navigate > Class
(shortcut: double click shift ORctrl + N
) - Click to locate the source in the pop-up
- Select the directory Prefetching Library/android_prefetching_lib/src/main
- Set breakpoints
- Run the app in debug mode
Important: Changes in the library source code will not take effect in the sample app until updating the imported AAR file