RolePlay onLine RPoL Logo

, welcome to [Unofficial] RPoL Mobile App Discussion

10:33, 23rd April 2024 (GMT+0)

Android: General Discussion.

Posted by NinthbitFor group 0
Ninthbit
GM, 20 posts
Android App Dev
Your humble host
Wed 19 Jun 2013
at 01:57
  • msg #22

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
  • msg #23

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
  • msg #24

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
  • msg #25

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
  • msg #26

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
  • msg #27

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
  • msg #28

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
  • msg #29

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

Ninthbit
GM, 24 posts
Android App Dev
Your humble host
Fri 21 Jun 2013
at 20:05
  • msg #30

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
  • msg #31

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
  • msg #32

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
  • msg #33

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
  • msg #34

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
  • msg #35

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
  • msg #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
  • msg #37

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
  • msg #38

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
  • msg #39

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
  • msg #40

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
  • msg #41

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
  • msg #42

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
  • msg #43

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!
ashberg
player, 16 posts
Fri 29 Nov 2013
at 06:50
  • msg #44

Re: Android: General Discussion

*chuckle*

At first my F5 was grateful for the reprieve... but now he's all like "WHY DON'T YOU EVER CALL ME?"
ashberg
player, 17 posts
Tue 18 Feb 2014
at 05:34
  • msg #45

Re: Android: General Discussion

Is there a way to disable notifications from particular threads within a game?

Eg - I don't want a notification about the Apple iOS Development thread in this board.
cannonc
player, 3 posts
Tue 18 Feb 2014
at 13:43
  • msg #46

Re: Android: General Discussion

I highly doubt it.

I'm not a programmer, but it sounds like the apps go off the information from the Main Menu (red/blue/purple notifications), and don't actually look deeper into the games themselves.
Sign In