Android: General Discussion.   Posted by Ninthbit.Group: 0
Ronning
 player, 1 post
Wed 19 Jun 2013
at 00:43
Re: Android: General Discussion
I havent had this issue. Tmobile's Samsung galaxy sI using AKOP android.

Ive had a bunch of games on my sticky list, just monitoring different things and reading threads. Upon installing the app, I was alerted to every single thread I had on my sticky. Ignore list works well although I had to do some research to figure out where the game ID was located. There is also a small discrepancy with the coma placement but that is easily remedied. Once I had figured everything out, it works gloriously.

Just wanted to give my two cents as a GM here on RPoL... Very awesome app. Good work Ninthbit.
Ninthbit
 GM, 19 posts
 Android App Dev
 Your humble host
Wed 19 Jun 2013
at 01:06
Re: Android: General Discussion
Ignore list is something I plan to tackle.  Im hoping to be able to list all a users games and apply setting per game.  I really want to eventually expand out to a full blown mobile client for the site.  I'm debating if I should fork the app.  One version for simple notifications like we currently have, and a second that has support for reading threads, writing posts, and rMail.
ashberg
 player, 9 posts
Wed 19 Jun 2013
at 01:09
Re: Android: General Discussion
There'd be a tonne of work in replicating the features for authoring posts, surely?? Formatting, colours, private lines, secret to's... I suppose it's all fairly rudimentary though. Hmm.

One thing with app development though: need to ask yourself, Why build an app? Will it improve on the native website?

For the notification app - yes, it certainly improves the native website's notification offering.

But a second app that is an RPOL client? You'd be reinventing the wheel, no?
Ninthbit
 GM, 20 posts
 Android App Dev
 Your humble host
Wed 19 Jun 2013
at 01:57
Re: Android: General Discussion
For someone like me, who spends 99% of his online time using a Galaxy Note, any advantage is worth the effort.  The browser is fine for reading, but it does involve a lot of pinch and zoom.

Formating new posts is a pain in the browser though.  Highlighting passages and adding formating doesn't work well at all.  Having a mobile client that takes this into account could help a lot (though I agree, it would be a lot of work).

In any case, making this app is more of a hobby anyways.  I've learned a LOT about Java and the Android platform.  The main reasons I was thinking of forking the development is because after the next version, I can't really think of anything I would want to add to the notification portion.  Also, by forking, I can leave a light weight and stable product that just about anyone can use.
Thruxus
 player, 1 post
Wed 19 Jun 2013
at 02:10
Re: Android: General Discussion
I use a HTC One X, and yeah, there is a lot of Pinch and Zoom, and highlighting text is a no go. Although my screen is smaller than the Galaxy note, I would love to have an actually program, that I could load up to replace how I post from my phone. Simple Mobile viewing, formatting for my screen size.
Ronning
 player, 2 posts
Wed 19 Jun 2013
at 02:16
Re: Android: General Discussion
looks like you have to do it now Ninthbit
Ninthbit
 GM, 21 posts
 Android App Dev
 Your humble host
Wed 19 Jun 2013
at 02:56
Re: Android: General Discussion
It's half the reason I published the app.  Peer pressure  :)  I've used a hard coded version since January.  By sharing it, I was forced to make it more user friendly.  Plus, it's nice not having to manually type my Google Cloud Messaging ID each time I reinstall because I changed a setting.  The GCM ID is LONG.

Example:
APA91bHYMC9u6GB8Rczg-p7Bd3WrZTYjzuGaFl8f3jQhgbf6ZBfIHpsoIGEXg
gKvgxjTxBJlNZTZTy9tMIkPOrZUArQwbeovu0nVRfzaxSEc8K1Jcr2cCbPQxL
f-lttP_MD-YOmtNFkKXVkJpibvi2kHK7cr9a18FEckxL--Z-RTFJoiZFffiUE

Yup... in the first version, you had to read that off the screen of the phone and then manually edit it into a PHP script.  There was no database or web based registration.  I was typing it in a unix terminal using vi.  Peer pressure makes some things better.



BTW, here is the relevent section of code for the browser chooser for anyone that knows Java/Android:
     // set the activation action to open the browser to the game
        String strURL = RpolScraper.getSiteURL(context) + "/game.cgi?gi=" + strGameID;
        Uri uri = Uri.parse(strURL);
        Intent notificationIntent = new Intent(Intent.ACTION_VIEW, uri);
        //force browser choice
        Intent finalIntent;
        if (sharedPrefs.getBoolean("forcebrowserchoice",  false) ){
                finalIntent = Intent.createChooser(notificationIntent,"Choose Broswer");
        } else {
                finalIntent = notificationIntent;
        }

        PendingIntent pintent =
                PendingIntent.getActivity(context, 0,  finalIntent, 0);


I don't see how the browser choice is losing the game's ID.  If I can't reproduce the problem tommorow, then I'm incline to think it's a browser problem.  I'll try a few diffrent ones and send a bunch of notificatinos.  I already have a script on the server that allows me to fake a notification, forging GameID, Tittle, and Summary.  The only things I can think of are tab limits, or if new tabs open in the background.  :/
Ninthbit
 GM, 22 posts
 Android App Dev
 Your humble host
Wed 19 Jun 2013
at 17:08
Re: Android: General Discussion
Well that took FOREVER to find.  Since the PendingIntents were all calling the Intent.createChooser with just different extras the system thought it was the same and didn't create new ones.  You have to specify an ID to differentiate between them, BUT GOOGLE DIDN'T FEEL THE NEED TO DOCUMENT THAT!!!

Google's Documentation:
public static PendingIntent getActivity (Context context, int requestCode, Intent intent, int flags)

Retrieve a PendingIntent that will start a new activity, like calling Context.startActivity(Intent). Note that the activity will be started outside of the context of an existing activity, so you must use the Intent.FLAG_ACTIVITY_NEW_TASK launch flag in the Intent.

Parameters
    context The Context in which this PendingIntent should start the activity.
    requestCode Private request code for the sender (currently not used).  <--- My applesause this isn't used!!!!
    intent Intent of the activity to be launched.
    flags May be FLAG_ONE_SHOT, FLAG_NO_CREATE, FLAG_CANCEL_CURRENT, FLAG_UPDATE_CURRENT, or any of the flags as supported by Intent.fillIn() to control which unspecified parts of the intent that can be supplied when the actual send happens.

Returns
Returns an existing or new PendingIntent matching the given parameters. May return null only if FLAG_NO_CREATE has been supplied.


In any case... I found a StackOverflow article that was similar and it was pointed out there.  I stuffed the game ID into function and it's working now.  Bug squished, v2.00.02 has been sent to the Play Store.  It takes about 4-6 for them to finally publish it out.  For the impatient that have "Unknown Sources" enabled, the APK is HERE
ashberg
 player, 10 posts
Thu 20 Jun 2013
at 10:16
Re: Android: General Discussion
Aha! Sounds like you nailed it!

I will apply the update tonight and let you know how it goes.

I better go post in all my stories, to ensure some replies to test it with ;)
ashberg
 player, 11 posts
Thu 20 Jun 2013
at 11:18
Re: Android: General Discussion
Thought....

Any chance of a "test vibration" button?
Ninthbit
 GM, 23 posts
 Android App Dev
 Your humble host
Thu 20 Jun 2013
at 15:00
Re: Android: General Discussion
Or I can just open my notification tester to everyone.  I've updated it to support multiple users.  You just need to enter the hash from your news feed.  By doing it this way, you can actually do a full test.  For example, LED color can only be checked if the screen is OFF when the notification comes in, otherwise it won't light up.
http://www.evilknights.com/rpol/SendNote.php



To find your hash, go to your list of feeds:
/usermodules/profile.cgi?action=feeds

What we're looking for from that page:

Your Feeds
RDF v1.0http://m.rpol.net/feeds.cgi?q=1CEBKD8halkgRSsf54wU
RSS v2.0http://m.rpol.net/feeds.cgi?q=2CEBKD8halkgRSsf54wU
Atom v1.0http://m.rpol.net/feeds.cgi?q=3CEBKD8halkgRSsf54wU

Ninthbit
 GM, 24 posts
 Android App Dev
 Your humble host
Fri 21 Jun 2013
at 20:05
Re: Android: General Discussion
Ok... another bug update (v2.01.00) has been published.  It will be in the market in a few hours.  I rewrote and updated the login\registration process.  It was causing the login screen to launch whenever the app launched from a new process (full exit, and then opened).

Because of the way the login was checking if you had already registered, the app may continue to have the quirk until you clear your data.  Since I had already wiped mine as part of the debug process, I can't be sure.

After updating, if you continue to have the problem.  First try to unregister the app via the menu.  This way you won't lose your custom settings.  Worst case, uninstall and reinstall.
ashberg
 player, 12 posts
Mon 24 Jun 2013
at 08:55
Re: Android: General Discussion
Hey :)

Looks like I'm not getting private message notifications. Test it here. Send me a pm.

Also, how often does it scrape for new post info? Can the timing or frequency be set by the user? Some days hourly is good, other days instantly is good
Ninthbit
 GM, 25 posts
 Android App Dev
 Your humble host
Mon 24 Jun 2013
at 13:01
Re: Android: General Discussion
Well son of a biscuit... Looking at it, I don't think PMs have ever worked correctly.  :(

The server side script that scraps the XML feed checks that there are messages of some kind.  It reads that the summary does not report no new messages.  Just to clarify, double negatives are common in programming.  (Not nothings, means there is something)

Here is the kicker, I was checking the <updated> element to make sure I only reported the notification once.  If the games time stamp was the same as the previously scraped feed's, then it wouldn't send a notification.  The problem here is that I'm just realizing that this time-stamp doesn't update for PMs.  It only updates for public threads.

I'll need to think of a decent solution, because right now the only thing that's coming to mind is a new php function that makes database entries for each player, with each game, the games last status, and the last time a notice was sent for it.  It is not the end of the world, just more DB setup and coding.  I basically need to rewrite half of the server side script.  It won't be happening today, or even this week most likely.  (I already blew of a lot of work last week to squash bugs, I need to get caught-up with what pays my bills.)

Relevant part of XML feed from RPOL
<entry>
   <title>%5BUnofficial%5D RPoL Mobile App Discussion</title>
   <link href="http://m.rpol.net/game.cgi?gi=55883" />
   <id>tag:rpol.net,2005:1.55883</id>
   <updated>2013-06-02T01:52:17Z</updated>
   <category scheme="http://m.rpol.net" term="Games You Own" />
   <summary>There are no new messages.</summary>
</entry>


Relevant PHP code from the Notification Server:
 foreach (array_keys($new_data) as $key ) {
    $sendnotice = false;

    if ($new_data[$key]->summary != "There are no new messages."){
      if (array_key_exists($key, $old_data)){
        if ($new_data[$key]->updated != $old_data[$key]->updated) {
          $sendnotice = true;
        }
      } else { $sendnotice = true;}
    }

    if ($sendnotice == true) {
        GCM_notify($GCMUser, $new_data[$key]);
    }
  }

Ninthbit
 GM, 26 posts
 Android App Dev
 Your humble host
Tue 9 Jul 2013
at 17:57
Re: Android: General Discussion
The private messages should be working now. If someone wants to drop me a PM I'll know for sure that it's working.  It tested fine on the BETA site.  I can't manually test it on the main WWW site due to RPoL's duplicate account policy. (cannonc got me the PM I needed with his RTJ)

Here's how it works (and it's pitfall):
When the feed is being read, if a game is listed as having new private messages (Blue on the main screen).  It will check if it had any private messages the last time it checked your feed.  If not, then it must be new and a notice is sent.

Now the pitfall:  If in-between feed checks you have read all your new PMs and then after received a new PM, the script has no way to tell that the newest PM isn't an old one that hasn't been read, so it won't send another notice.  It will assume its the same old one.

This message was last edited by the GM at 18:45, Tue 09 July 2013.

ashberg
 player, 13 posts
Wed 7 Aug 2013
at 22:25
Re: Android: General Discussion
Hey mate. Hows the development world? :)

I had a thought: I'd love to be able to set different alert sound and vibration pattern for both Private and Public messages.

Is this doable?
Ninthbit
 GM, 27 posts
 Android App Dev
 Your humble host
Wed 7 Aug 2013
at 22:33
Re: Android: General Discussion
Shouldn't be hard.

BTW, sorry there hasn't been any updates in a while.  I recently become obsessed with aquariums.  I'll try to knock this little feature out though.  Should be easy enough.
ashberg
 player, 14 posts
Wed 7 Aug 2013
at 22:36
Re: Android: General Discussion
You're the best ^_^

Aquariums are, indeed, a fine hobby.

Though I prefer to keep lizards. ;)
Ninthbit
 GM, 28 posts
 Android App Dev
 Your humble host
Thu 8 Aug 2013
at 21:55
Re: Android: General Discussion
Ok... I got this done WAY sooner than I expected.  Slow day at work.  Version 2.02.03 should hit the Android market in a few hours.  For the impatient, if you have your security set to allow Unknown Sources, you can download it directly from here: http://www.evilknights.com/rpol/release/

v2.02.03
Added new settings for Private messages.  Per the request, you can specify a separate sound for Private messages.

Additionally, there are now two ignore lists.  Public will ignore only public messages to a game.  The new Private list will supersede Public, so if a game is on this list, ALL notifications will be ignored (like the old version).  Your previous ignore list is saved as the Public list in the current version, so if you want any of those entries to be fully ignored, you need to move them to the private ignore list.

Also added a new menu option to clear portrait information.  To prevent the app from trying to download your portrait for EVERY notification, the previous version would grab it from the first notice and save it.  Unfortunately, if you changed portraits the app would not update.  Now you can clear the list and each portrait will refresh.
ashberg
 player, 15 posts
Thu 8 Aug 2013
at 22:12
Re: Android: General Discussion
Looking forward to testing! :)
Ninthbit
 GM, 29 posts
 Android App Dev
 Your humble host
Thu 8 Aug 2013
at 22:18
Re: Android: General Discussion
I've been wanting the separate ignore list, but just haven't gotten in the code in a while.  Figured since I was there I'd add it too.  I have a few games I co-GM, and with their high post count, I had to ignore them.  Now I can still be flagged with a PM.  :)

Clearing the portraits was a back burner thing since I could clear the apps data and re-register.
Ninthbit
 GM, 30 posts
 Android App Dev
 Your humble host
Wed 21 Aug 2013
at 20:33
Re: Android: General Discussion
OK... here is the source.

https://github.com/ninthbit/RPoLNotifier

It's ugly... but it works :)
Xilanada
 player, 1 post
Thu 31 Oct 2013
at 17:59
Re: Android: General Discussion
This is a lovely app and standard for me throughout the day.  Should you ever feel motivated on making an Rpol browser-replacement, I'd adore it (it's annoying having to pinch and zoom to read stuff and I wouldn't dream of actually replying on Rpol with the browsers the way they are).

One comment: I've noticed the app only seems to work on one device at a time.  I had it on my phone but, when I installed it on my tablet, it stopped working on my phone.  Once I cleared everything on the phone and relogged in, it stopped working on the tablet.

Not sure if that's a bug or lack of feature but it'd be awesome if it could work in more than one place. :)

Thanks again for creating and supporting this tremendous app!
Ninthbit
 GM, 31 posts
 Android App Dev
 Your humble host
Thu 31 Oct 2013
at 18:08
Re: Android: General Discussion
Its not a bug, it due to the simplicity of the database.  Most people have there phone near them, even when they're on their tablet.  I've looked at making a full (or at least functional) client, however I really haven't had much time to code anything recently.  Not to mention, that becomes a huge task.  Maybe someday though :)
Xilanada
 player, 2 posts
Thu 31 Oct 2013
at 18:21
Re: Android: General Discussion
Yeah, I have it running on my phone and it does the trick just fine.  This is definitely a 'nice to have' as opposed to a 'need to have' feature request.

Thanks again for making the app in the first place.  :)  My F5 key on the keyboard thanks you too!