This document defines the optimal architecture for saved articles sync and display in android-phoenix, addressing parallel batch downloading, Room persistence, Kotlin coroutines state management, and Compose loading patterns across multiple cache layers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Convert a file to a String. | |
| * | |
| * @param fileName the filename to read | |
| * @return the file formatted as a String | |
| */ | |
| public static String readFile(@NonNull Context context, @NonNull final String fileName) { | |
| BufferedSource source; | |
| try { | |
| InputStream inputStream = context.openFileInput(fileName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Error: bind EADDRINUSE null:3777 | |
| //How do I change this to a port that isn't in use | |
| // Include the cluster module | |
| var cluster = require('cluster'); | |
| // Count the machine's CPUs | |
| var cpuCount = require('os').cpus().length; | |
| var http = require('http'); | |
| var net = require('net'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //#Main Repository link: https://github.com/ProxyApp/ProxyApi/blob/youtube_middlware/ | |
| //#File: https://github.com/ProxyApp/ProxyApi/blob/youtube_middlware/middleware/userMiddleware.js | |
| //User middleware function can reference res and next inside the firebase 'function(error)' | |
| //callback and return a response status or call 'next(error)' | |
| modifyUserGroups: function (userId, groups, res, next) { | |
| firebaseStore.child(vals.USERS).child(userId).child(vals.GROUPS) | |
| .update(groups, function (error) { | |
| if (error) { | |
| //these get called correctly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
| <item android:drawable="@drawable/ic_card_icon_alpha_30" android:gravity="left"/> | |
| <item android:drawable="@drawable/ic_card_icon_alpha_70" | |
| android:gravity="left" | |
| android:left="20dp"/> | |
| <item android:drawable="@drawable/ic_card_icon" android:left="50dp"/> | |
| </layer-list> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public enum NotificationCard { | |
| WHOOPS(0, KEY_DISMISSED_WHOOPS, R.string.notification_safe_info_title, | |
| R.string.notification_safe_info_message, R.raw.ic_alien, | |
| R.color.common_deep_purple, R.string.ok), | |
| SAFE_INFO(1, KEY_DISMISSED_SAFE_INFO, R.string.notification_safe_info_title, | |
| R.string.notification_safe_info_message, R.raw.ic_chameleon_framed, | |
| R.color.common_proxy_purple, R.string.ok), | |
| SHARE_PROFILE(2, KEY_DISMISSED_SHARE_PROFILE, R.string.notification_share_profile_title, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| const _ = require('underscore'), | |
| middleware = require('../middleware/common'), | |
| sharedMiddleware = require('../middleware/sharedLinkMiddleware'), | |
| vals = require('../middleware/middlewareGlobals'); | |
| var UserMiddleware = function (store) { | |
| this._firebaseStore = store; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Ensure authorization with firebase before requesting any data. | |
| * @param req request | |
| * @param res response | |
| * @param next call next | |
| */ | |
| middleware.ensureAuthenticated = function (req, res, next) { | |
| var authToken = req.query.auth; | |
| if (authToken == null) { | |
| console.log("Null firebase token"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var express = require('express'); | |
| var Firebase = require('firebase'); | |
| var router = express.Router(); | |
| //var firebaseUsersRef = new Firebase('https://dazzling-torch-1917.firebaseio.com/users'); | |
| var firebaseUsersRef = new Firebase('https://proxy-test.firebaseio.com/users'); | |
| //var galen = {id: "google:101993683995198877055", name: "galen"}; | |
| //var evan = {id: "google:109993703609292176173", name: "evan"}; | |
| //var sUsers = ["google:101993683995198877055", "google:101993683995198877055"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * I use the BaseCommand class to encapsulate data used to make an Rx Observable call. | |
| * An Rx call usually combines the action of saving a model object to firebase, | |
| * converting the model to a RealmObject and also saving to Realm into one atomic function flow with | |
| * an EventCallback. BaseCommands are posted from any Fragment or Activity with ProxyApplication.java's | |
| * getRxBus().post() method. The BaseCommand is then processed in ProxyApplication which creates an | |
| * IntentService to call the posted BaseCommand's interface ExecuteCommand, "execute()" method. | |
| * This returns a list of events, List<EventCallback>, which contain the updated user data to | |
| * post to subscribers of the event type. | |
| */ |