🚀 Android 15 (API 35) Upgrade & Firebase Storage Refactor
What's New?
This PR modernizes the project by updating dependencies and ensuring compatibility with Android 15 (API 35) while improving image loading performance.
Changes & Improvements
✅ Upgraded project to target Android 15 (API 35).
✅ Updated Glide to the latest stable version for better image handling.
✅ Removed outdated com.firebaseui:firebase-ui-storage:6.1.0.
This was necessary due to incompatibility with API 35.
Since FirebaseStorageReference can no longer be used for loading images, a new approach was implemented.
New Utility Class: StringUtils
📌 Purpose: Converts gs:// Firebase Storage URLs into standard HTTP URLs for seamless image loading.
📌 Key Implementation:
public static String convertGsUrlToHttp(String gsUrl) {
if (gsUrl == null || !gsUrl.startsWith("gs://book-dash.appspot.com/")) {
return null;
}
String path = gsUrl.substring("gs://book-dash.appspot.com/".length());
try {
String encodedPath = URLEncoder.encode(path, StandardCharsets.UTF_8.toString());
return String.format("https://firebasestorage.googleapis.com/v0/b/book-dash.appspot.com/o/%s?alt=media", encodedPath);
} catch (UnsupportedEncodingException e) {
Timber.tag("URLConversion").e(e, "Failed to encode URL");
return null;
}
}
Refactored Classes
The following classes were updated to use StringUtils instead of FirebaseStorageReference:
🔹 BookAdapter
🔹 DownloadsAdapter
🔹 BookInfoActivity
🔹 MyGlideModule
Why This Matters
🚀 Future-Proofing: Ensures the project stays compatible with the latest Android version.
⚡ Improved Performance: More efficient image loading without relying on deprecated Firebase UI components.
🔧 Code Maintainability: Uses a simple, reusable utility method for Firebase Storage URLs.
What's Changed
- 🚀 Android 15 (API 35) Upgrade & Firebase Storage Refactor by @mandivandermerwe in #67
Full Changelog: Release-2.9.3...Release-2.9.4