Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Latest Threads
A Buton on controller pau...
Last Post: ShieldHero38
03-13-2024, 04:46 AM
How to add cheats on 3DS ...
Last Post: AnimeJesus
03-13-2024, 02:53 AM
[BUG] Nintendo Switch Pro...
Last Post: hexaae
03-13-2024, 02:10 AM
Latest build not availabl...
Last Post: hexaae
03-05-2024, 09:02 AM
mGBA won't read save game...
Last Post: gam3rsmedia
02-28-2024, 04:13 AM
Save State Information - ...
Last Post: Other
02-27-2024, 03:43 AM
pokemon timeS
Last Post: endrift
02-14-2024, 12:27 AM
Forum emails resolved
Last Post: endrift
02-09-2024, 09:45 AM
bilinear filter for ninte...
Last Post: joel20242024
01-24-2024, 02:10 AM
Weird issues with SNES Co...
Last Post: 7NGEL`
01-22-2024, 05:41 AM

Forum Statistics
» Members: 1,410,   » Latest member: NameChild,   » Forum threads: 586,   » Forum posts: 2,262,  
Full Statistics

  [Android] GameList: Grid vs List
Posted by: ds84182 - 05-26-2016, 10:14 PM - Forum: Development - Replies (3)

First, here are images of grids and lists from the Material Design Guidelines

List:
[Image: components_lists_keylines6.png]

Grid:
[Image: components_grids_specs12.png]

Grids are primarily for consuming audio visual content (eg. Videos Games, Movies, Music), while a list would work for textual content (eg. Settings, Messaging). Grid items focus on images while list items focus on text. Grids also allow more items on the screen, since in portrait you can have 2 items side by side, and in landscape you could have 3 or more items side by side (In landscape, on my phone, I can see 6 games at a time vs 2 games at a time (with a lot of wasted whitespace)).

So, to conclude, here's a list of pros and cons (and potential mitigations):

Grid:

Pros:

  • Save images are treated as a first class citizen so users can see what they were doing last and also identify the game without reading the title
  • A lot more games can fit on the screen at the same time

Cons:
  • Game titles get truncated (Mitigation: Long press a game to view its title in a Toast (This is also implemented by Netflix))

List:

Pros:
  • Users can see the title and any extra information that may be available (possibly publisher or last play date...)

Cons:
  • Uses up a lot of room on the screen, shows a lot of whitespace.
  • Save images are swept off to the side. Users can still get context but it isn't the main focus.
  • Only 3-5 games can be shown on a screen in portrait at a time vs 6-15 with a grid.

Print this item

  [Android] rxJava vs Agera
Posted by: ds84182 - 05-17-2016, 09:58 PM - Forum: Development - Replies (3)

So a long long looooooong time ago, some person thought "What if we could respond to things changing directly after they change instead of constantly polling?" Thus, Reactive programming was formed.

rxJava

Now, even though rxJava stands for "reactive extensions for Java," rxJava is more functional programming than reactive.

rxJava focuses on event driven data flow using dynamically built observables. rxJava observables can send a total of 3 events: Data, Error, and Done. rxJava has flow control operators too, like filter, reduce, map, etc. Flow control operators basically act like a subscription that sends data to another subscription in a chain. This can be extremely inefficient because of all the object allocation that goes on. It also has a rather confusing threading model, since rxJava was made to use in desktop Java applications.

Agera

While Agera is rather new, it gives reactive programming crafted explicitly for Android. At the core of Agera, you have these interfaces: Observable, Updatable, Receiver, Result, and Supplier. Unlike rxJava, reacting comes first and data flow second. And inside of Agera's implementations it uses Android primitives, like Loopers and Handlers, to communicate and automatically debounce duplicate updates to updatables (this also ensures that the thread you used to subscribe on is the one responsible for handling the updates).

Agera also has results. Results represent the actual data, and they have 3 different states: Present, Failed, and Absent. This allows the program to optionally synchronously handle data if it has already been loaded.

An example

Lets say we're loading a list of games from multiple directories on the filesystem. For each game we must ensure that it's valid and create a new Game object from the file.

rxJava:

Loader implementation:

Code:
Observable.from(directories) // Each of these steps cause some sort of allocation!!
   // Missed implementation detail: ReplaySubject madness that would allow for caching.
   .subscribeOn(Schedulers.io()) // Or maybe it's observeOn... I don't know. rxJava is kinda ambiguous here...
   .map(File::listFiles)
   .flatMap(Observable::from)
   .map((file) -> {
       if (Game.isValidGame(file)) {
           return Game.from(file);
       }
       return null;
   })
   .filter((game) -> game != null)
   .toList();

Using the loader:
Code:
loadGameLater() // Not seen: The method and the class that returns the above observable
   .observeOn(AndroidSchedulers.mainThread()) // Same comment from above...
   .subscribe(list -> {
       // Do something with the list here...
   });

Agera:

Loader implementation:
Code:
public class GameList extends BaseObservable implements Supplier<Result<List<Game>>> {
   private Result<List<Game>> result = Result.absent(); // Returns a reference to a static and immutable object
   // Also, as a consequence, we get caching!

   @NonNull
   @Override
   public Result<List<Game>> get() {
       return result;
   }

   @Override
   protected void observableActivated() {
       // Called when the GameList goes from 0 subscribers to 1 or more
       loadDataIfAbsent();
   }

   private void loadDataIfAbsent() {
       if (result.isAbsent() || result.failed()) {
           executor.execute(() -> { // Not seen: Java thread executor that runs this on another thread
               try {
                   List<Game> games = new ArrayList<>();
                   // Essentially the raw logic from rxJava
                   for (File directory : directories) {
                       for (File file : directory.listFiles()) {
                           if (Game.isValidGame(file)) {
                               games.add(Game.from(file));
                           }
                   }
                   result = Result.present(ImmutableList.copyOf(games));
               } catch (Exception ex) {
                   result = Result.failure(ex);
               }

               dispatchUpdate();
           });
       }
   }
}

Using the loader:
Code:
// Not seen: The class that has these methods and fields
private GameList gameList = new GameList(); // This would be a singleton somewhere and injected by Dagger
private boolean observing = false;
private void startObserving() {
   if (!observing) {
       gameList.addUpdatable(onGameListChanged);
       // Advantage: If a piece of code clears the cache (say a new library directory) we get notified!
       onGameListChanged.update(); // We have to call this after registering so previously cached data can be loaded
       observing = true;
   }
}

private Updatable onGameListChanged = () -> {
   Result<List<Game>> result = gameList.get();
   if (result.isPresent()) {
       List<Game> list = result.get();
       // Do something with the list...
   }
};

private void stopObserving() {
   if (observing) {
       gameList.removeUpdatable(onGameListChanged);
       observing = false;
   }
}

As you can see the rxJava implementation is shorter than the Agera implementation... However, the Agera implementation has caching and proper reactivity. In rxJava caching means taking extra care to make sure that multiple threads don't request something at the same time, which causes the data to load multiple times (!!!) before caching. Furthermore, Agera deals with all the threading madness and DOESN'T create multiple objects just to do something simple.

Who is using rxJava?

There are 8,156 projects that use rxAndroid and rxJava on Github.

Who is using Agera?

There are 42 projects that use Agera on Github (due to the age of the library). Google uses Agera inside of their Google Play Movies app (which is where the code was extracted from).

Because Google made Agera, they may soon make it a recommended library. It's also made for Android instead of generic Java applications.

Print this item

  [Android] Retrolambda: What it is, how it works, and why should we use it
Posted by: ds84182 - 05-17-2016, 08:55 PM - Forum: Development - Replies (3)

What is it? How does it work?

In Java 8, Oracle introduced lambdas. These lambdas are implemented as nameless anonymous classes, a feature that has been in Java for ages. Retrolambda is a compile time library that utilizes JDK 8 to convert classes that use lambdas to use normal anonymous classes.

Why should we use it?

Consider this example copied from port/android-agera:

With Retrolambda:

Code:
Collections.sort(games, (a, b) -> a.name.compareTo(b.name));

Without Retrolambda:
Code:
Collections.sort(games, new Comparator<Game>() {
   @Override
   public int compare(Game a, Game b) {
       return a.name.compareTo(b.name);
   }
});

Java 8 lambdas also allow you to bind methods into lambdas (as long as the method signature matches the interface):

Code:
handler.postDelayed(this::hideToolbar, 1000);

vs.

Code:
handler.postDelayed(new Runnable() {
   @Override
   public void run() {
       hideToolbar();
   }
}, 1000);

Compile time costs:
None, the process of converting Java 8 to Java 7 is extremely fast.

Who uses it?

According to GitHub, Retrolambda is used in 4,160 projects (judging from the number of Gradle files that include it). It could be used in even more places, since this is a compile time dependency.

Print this item

  Forums rearranged and simplified
Posted by: endrift - 05-17-2016, 08:34 PM - Forum: News - No Replies

In the interest of simplifying the forums, several changes have been made:

  • General and Support have been merged together. The difference between the two boards was always a bit poorly defined, so there's only one board for them now.
  • The two gaming boards were merged and put into off topic. They didn't see any traffic, anyway.
  • A new development section was added, by request. This is primarily for developers talking about potential changes, or discussing changes that are made, not for the average user.
Hopefully this will make browsing the forums less confusing now!

Print this item

  I still can't figure out how to use cheat codes!
Posted by: mooschu - 05-02-2016, 03:37 AM - Forum: General - No Replies

I'm gonna need a step by step guide on how to enter cheat codes. I've read the other threads, but I just can't seem to figure it out. Maybe I'm missing something here. I'm using the released version 0.4.0 for Windows. I'm trying to use action replay codes.

Thank you

Print this item

  Fast Forward button settings
Posted by: LimitCrown - 04-29-2016, 09:53 PM - Forum: General - Replies (2)

Is there a way to disable the ability to fast-forward temporarily? When I'm using my Logitech gamepad, I accidentally hit the right trigger button or the left trigger button sometimes, which causes games to fast-forward or pause, respectively.

Print this item

  I need a guide on how to use cheat
Posted by: longxa762 - 04-14-2016, 10:59 AM - Forum: General - Replies (5)

How do you exactly use the cheat system I'm so confused. I got some GameShark that I'm sure 100% working on other Emulator, but I can't figure out how do you suppose to enter it in mGBA.

So I click Add New Set, put my code in the blank space, then click Add Gameshark, it do nothing and if I don't click on the available set, it will automatic create a new emty set. Tried all the Add option and the only way to add it was to click on the Add button, but adding the code using that option doesn't do anything ingame.

edit: is it possible to change the keybind for fast forward/speed up? everytime i save in crucial point sometime the game just stuck in speed mode and i have to press space to change it back
edit2: ok I figure it out, it seem mgba doesn't support the gameshark code(the code is too short?) so i found some codebreaker and it worked

Print this item

  mGBA for Wii
Posted by: Malphas - 04-11-2016, 11:36 PM - Forum: General - Replies (2)

Is there a way to activate speed? I've googled it a bunch and I saw the pc version has a turbo button holding TAB so I'm wondering if the one for the Wii also has one. If yes, how do I use it, if not, will you ever add it? Some games with grinding like Pokemon and Breath of Fire get really boring if you have no turbo/speed button. Also whether it has it or will eventually be added. It would be great if it were a toggle as opposed to holding of a button.

Print this item

  Question about mGBA (RetroArch version) for the Wii
Posted by: dagreatbuzzsaw - 04-11-2016, 03:54 AM - Forum: General - Replies (4)

Hello,
I recently got RetroArch v1.3.2 for the Wii and with it came the core for mGBA. I tried it and found that it works a heck of a lot better than VBA-Next! It's just more fluid, there's no signs of slowdown during certain points of the game, and there's no DSI exception errors (at least none I know of yet) of which I've been experiencing frequently with VBA-Next, and frankly I'm fed up with that.

I want to use mGBA for all my games, but the only thing stopping me is cheat support for it. Cheats don't seem to work with it and I've heard through other posts that it simply hasn't been implemented yet. I don't know if you guys have a hand in the RetroArch version of mGBA, but do you guys know if and when cheat support will be enabled for it??? Thank you guys for your time and attention. Smile

Print this item

  how to build mgba standlaone for wii ?
Posted by: yoyoliyang - 04-08-2016, 02:03 AM - Forum: General - Replies (1)

Hi,I use my wii to run mgba standalone,but the speed is slow.when I saw your source on github,I found the audio SampleRate is 48KHZ.
Now I wan't change it to 32KHZ and re build the .DOL file for wii.
So,how should I do? I need what SDK on linux or windows to build it? Use cmake or gcc or other?
thanks!

Print this item


Online Users
There are currently 69 online users. » 0 Member(s) | 69 Guest(s)

Powered By MyBB, © 2002-2024 Melroy van den Berg.