Jump to content

OCR Android App


qwertymodo
 Share

Recommended Posts

For awhile now, I've been wanting to stream OCR music to my Android phone, and have looked into several ways of doing so, eventually just settling on downloading the library and re-uploading it to my Google Play Music account, but the one thing that doesn't let me do is to browse or search by console/game/original song the way the OCR site does. So, I finally decided to delve into Android development and try to write an app myself. I've never done any Android development before outside of submitting a few patches to a CM7 fork I used to run on my old Droid X, but I've been programming for close to 10 years now and have done work in Java before, so I figured it could be a fun project. I managed to get the basic player working, but before I go any further, I need to figure out exactly how to go about getting the data I need. With that in mind, I have a few questions:

-Is there any public-facing interface for performing searches that returns raw data? Right now, all I can see is to do an HTTP request to http://ocremix.org/quicksearch/[game/remix/artist/album]/?qs_query= and then parse the HTML, which works ok, but has the potential to completely break on malformed HTML or any future site changes.

-I currently have a rough proof-of-concept working, but is there anybody around here with Android experience who would be willing to collaborate on the app? This isn't a "hey guyz I have this SUPER C00L idea can somebody write all the codeZ????? PLZ RESPOND!!!" request, I am mostly looking for help with UI and system message handling. I'm an experienced programmer, and I'm more than capable of getting my Android-specific questions answered through other channels, but having somebody else on board with previous Android experience would be a huge help.

-Is there any real interest for such an app? So far, this has just been a pet project that I thought up awhile back, and as such it may be doomed to the fate of far too many projects of mine that have made it to the "Hey, it works!" stage and then I lose interest and move on to something else. However, if there was real interest (or somebody willing to collaborate on the project), then maybe I'd be willing to actually make this thing nice...

-This may be a bit of a stretch at this early stage, but if the interest is there and I manage to get this up to a release-ready product, would there be any chance of an official endorsement? I'm not talking money, just I know you have an interest in protecting the OCR brand, so I wouldn't want to give the impression of this being an officially sanctioned app unless that were really the case, so I'm not sure on things like using the OCR logo for the app icon, or naming the app or things like that.

Anyway, here's the barebones proof-of-concept I have so far:

R1uHsKPl.png

Pretty simple. Type in a number between 1-2828 and it pulls up the corresponding remix, displays the title, and then you can hit play to play the song. Right now there are more bugs than features, a lot of system events aren't handled, and there's almost no error handling, but it does work. I managed to get the media player running in a background service though, so it continues playing in the background when you switch apps. If anybody's interested, here's the apk (again, this is just a proof-of-concept, it's ugly, it's hacky, don't send me bug reports): https://drive.google.com/file/d/0B9mkcXhEAawFYlJob2ZLSUhfTlk

Current permissions:

Read Phone State - Pause/Resume playback when you receive a call

USB Storage - Not currently used, but it was included in the example project I used as a template. Eventually, I'll use the SD card for local caching...

Full Network Access - Required for accessing the OCR site and streaming the songs.

Link to comment
Share on other sites

I think this would be great for OCR, right along with a mobile version of the forums.

If you could do something like this for iPhone eventually it would be great.. An OCR app would probably be one my top used apps because it's just so fun to search and listen to different OCReMixes. And it'd be a lot easier on an app than on the site.

Link to comment
Share on other sites

From what I can tell, the answer to my question about retrieving raw data is probably a no. Is there any chance that such a function could be added to the site, even something as simple as just replicating the current search functions but returning as plain JSON instead. So, say I wanted to search for Chrono games. Right now, I can pull up this link:

http://ocremix.org/quicksearch/game/?qs_query=chrono

and parse the HTML that I get back, but if there was some way to perform the exact same query and return the data formatted as JSON it would look like:

[
{
"sys":"ps1",
"title":"Chrono Cross",
"url":"http://ocremix.org/game/17/chrono-cross-ps1",
"year":1999,
"publisher":"Square",
"composers":"Yasunori Mitsuda",
"mixes":29
},
{
"sys":"snes",
"title":"Chrono Trigger",
"url":"http://ocremix.org/game/16/chrono-trigger-snes",
"year":1995,
"publisher":"Square",
"composers":"Nobuo Uematsu, Noriko Matsueda, Yasunori Mitsuda",
"mixes":119
}
]

It wouldn't be much extra code for the site, but it would be immensely helpful for a project like this...

Link to comment
Share on other sites

When I first clicked on this thread, I thought it was about an OCR Forums app :P

This would be an extremely awesome idea though, I hope you can make it happen! I'm trying to learn enough Java to code with Android, but it's more like a crash course at this point... smali is absolutely hell to try and read

Link to comment
Share on other sites

This is a great idea.

Would you also be able to integrate rainwave? (http://ocr.rainwave.cc/) There are no good apps on android to properly interact with it.

The RainWave app just needs to add a MediaPlayer background service rather than relying on an external app to act as a service listener. It's not hard, I got it working in a few hours. Just get ahold of the RW devs and point them here: http://www.glowingpigs.com/index.php/extras

Link to comment
Share on other sites

All of the async network calls for data retrieval are starting to make my head spin, but thankfully, once I manage to figure out a template for populating my data structures with all of the async calls, pretty much all of the browse and search functions should be pretty well boilerplated...

Link to comment
Share on other sites

Ok, it's becoming very clear to me that the design paradigms I'm used to working in are quite different from the Android ecosystem, so it's time to put a full stop to this rabbit hole I'm diving into and actually take the time to understand the design models and then start over. The proof-of-concept work will definitely be helpful, but to use that as my starting point would be to put the cart before the horse, as it were. The design phase matters, folks ;)

Link to comment
Share on other sites

Ok, so I took the time to back up and refactor my code into something actually maintainable, and now I feel a lot better about the prospects of this project. I haven't tackled the async network calls again yet, so no loading by ID or metadata lookup yet, but I have basic playlist functionality working, and most of the bugs squashed, so I guess it's time to write some more... code, that is, not bugs (though I'm sure I'll write plenty of those too :tomatoface: )

xEDBY6ll.png

Link to comment
Share on other sites

  • 2 years later...
  • 4 years later...
  • 5 months later...
On 3/16/2021 at 8:22 PM, TurtleSwift said:

I've been fiddling about with this for a while now...

Everything pretty much works, just need to test it more. I'm also not happy with how it looks just yet.

 

Very good! Will there be public playlists? I mean, playlists that all users of the app can listen to.

And what about desktop version and album streaming?

 

Link to comment
Share on other sites

10 hours ago, 12x_waver said:

Very good! Will there be public playlists? I mean, playlists that all users of the app can listen to.

And what about desktop version and album streaming?

 

Right now the only thing resembling a personal playlist is the library which lists all favorites and all downloads. Custom playlists should probably be added as well. Shouldnt be too hard. Of course playing any remix from any list page will act as a playlist (latest remixes, search..).

Anything more would be hard to do without creating some back end service where the app can get this info from. This wasnt my intention with the app though.

Albums are a bit tougher because the site handles them differently. Not all are available on the site. Some have a custom website, some are on soundcloud, some are bittorrent... Without an API/help from the staff this would be difficult to implement. Maybe the soundcloud albums could be supported though...

iMbYzd0.png

The next step I think are artist/remixer pages and game pages which will allow browsing all remixes by artist/game and getting more details about them. Still fixing bugs though.

Edited by TurtleSwift
Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...