Hi,

For testing, I compiled Drupalgap SDK without modifying the interface and run on phone, thanks, connect to my site successfully. However, the App interface seriously flickers / refreshes on every click / transition and often with intermediate white blank waiting screen while loading. The serious flicker / refresh / white blank screen made me fainted after playing awhile.

I thought Jquery mobile or even Phonegap wasn't ideal for developing Mobile App. However, I downloaded https://github.com/adappt/drupalphonegap (Also using jquery mobile) and compiled and run. Fantastic, the app interface works like native app, no such flickering / refreshes / white blank waiting screen effect like Drupalgap SDK on click & transition.

I really wonder. Thanks

Comments

tyler.frankenstein’s picture

Status: Active » Needs work

This is unfortunately a long standing issue, and is more obvious on older/slower devices...

  • Ideally we need someone extremely knowledgeable with multi-page jQuery Mobile applications, and linking/routing between those pages.
  • I'm not sure where this problem lies, but it seems to be related to any time an asynchronous call is being made to the server... any time there is an async call, DrupalGap tries to show/hide the jQuery Mobile loading/spinner widget, so perhaps that widget is interfering with the page transition; alternatively it must be an issue with how DrupalGap generates new pages in the DOM, and which jQM page/events are fired and when. Hence we need a jQM pro...

If anyone is interested in digesting how DrupalGap 1.x handles jQM pages, here are some key source code files of interest:

As you mentioned, the https://github.com/adappt/drupalphonegap has better performance? If so, please digest their page/event handling system and report any findings back here.

I'm open to suggestion and contribution on all of this... for DrupalGap 1.x. Perhaps the fix is really easy, and we just don't know it yet. Any research on why jQuery Mobile would flicker in PhoneGap would be helpful to organize here as well.

DrupalGap 2.x is being built on Angular, so this will no longer be an issue ;)

paulwdru’s picture

Hi,

Thank you for your sharing. I tested it on Samsung S2 & Note4. Also, the Drupalgap SDK App cannot be exited by pressing the back button on phones. I have to end it forcibly under App manager each time.

The said https://github.com/adappt/drupalphonegap SDK is provided by this module https://www.drupal.org/project/phonegap . However, I just compiled the SDK to see if any flicker / refresh / white waiting screen noticed, yet tested it with its phonegap module which seems having been discontinued in development.

I just finished assembling a fully Email-driven Ticketing System on Drupal and now looking into building a simple mobile app interacting with it with push notification and found this https://www.drupal.org/project/drupalgap_mobile_notifications

Drupalgap is resourceful with great suppport. I'll try to figure out the interface and post finding here once identified. Thanks

paulwdru’s picture

Hi,
Finally I tested https://www.drupal.org/project/phonegap with https://github.com/adappt/drupalphonegap , I'm able to login, retrieve the content view list and also post content. After login, the app interface still works nice with NO flickering / refresh / white screen on click / transition / retrieving / posting. Perhaps it's much simpler & light-weight if compared to drupalgap.

paulwdru’s picture

Hi,
I traced out the cause after experimenting http://www.w3schools.com/jquerymobile/tryit.asp?filename=tryjqmob_trans_... . Indeed, it's the default fade transition effect causing flickering.

I added "data-transition": "none" in settings.js for all links. However, it does not work because you use onclick javascript.

Then I was told to add the following between<script src="jquery-1.9.1.min.js"></script> and <script src="jquery.mobile-1.4.2.min.js"></script> to disable the default transition effect in global scope.

<script type="text/javascript">
	$(document).bind("mobileinit", function() {
	    $.mobile.defaultPageTransition = "none";
	    $.mobile.defaultDialogTransition = "none";
        });			
</script>

It works well without flickering anymore as web app and also on phone (android). However, on phone, after I click Create Content and the page shows, all the links become unresponsive and no longer functioning. I also tested it with emulator resulting in the same.

Now I solved the flickering but it crashed with Create Content page on phone / emulator. Any ideas ? Thanks

WillsCreative’s picture

Following this post. The constant screen flicker on every screen change makes it feel more like a website and less like an app

paulwdru’s picture

@WillsCreative

JQuery Mobile is set with Fade transition by default, just disable it as mentioned in #4, flicking will be gone then. However, I noticed that after disabling using

<script type="text/javascript">
	$(document).bind("mobileinit", function() {
	    $.mobile.defaultPageTransition = "none";
	    $.mobile.defaultDialogTransition = "none";
        });			
</script>

if your form contains unsupported field types by drupalgap, the form will become unresponsive during submission. I don't know why the codes can become conflicting with drupalgap.

d0t101101’s picture

@paulwdru - thanks for sharing this detail. I tried placing this in both index.html and in my theme's javascript, but it doesn't seem to take effect. The fade transition and flickering is still there.

Where exactly are you placing this javascript code?

.

tyler.frankenstein’s picture

Version: 7.x-1.12 » 7.x-1.x-dev
Component: Android App or Emulator » Mobile Application Development Kit Code
Category: Support request » Feature request
paulwdru’s picture

@d0t101101

The codes must be put between <script src="jquery-1.9.1.min.js"></script> and <script src="jquery.mobile-1.4.2.min.js"></script> in index.html. Otherwise it won't work.

kinmen’s picture

According to this post https://vjsamuel.wordpress.com/2015/01/12/removing-flickering-seen-in-co... you can try to change "data-transition": "none" to "data-transition": "slide"
OR
for Android ICS & lower, disable hw acceleration in the AndroidManifest.xml

credit to vjsamuel

d0t101101’s picture

Tyler - thanks again for helping me apply the 'none' transition globally, in my theme's .js, like so:

/**
 * Implementation of theme_link().
 * @param {Object} variables
 * @return {String}
 */
function easystreet3_link(variables) {
  try {
    if (typeof variables.options === 'undefined') { variables.options = {}; }
    variables.options.transition = 'none';
    return theme_link(variables);
  }
  catch (error) { console.log('easystreet3_link - ' + error); }
}

This really helped with this flickering issue...