O'Reilly Forums: Speed Up App Loading Time - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Speed Up App Loading Time

#1 User is offline   Cjackson111 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 23-February 13

Posted 23 February 2013 - 03:44 PM

Hello all. I have developed an iOS app (using PhoneGap, HTML5, CSS and JS). On the launch of the app it populates the local database from an XML file pulled from a server, which works fine. I am currently testing it on my device. Everything seems to work well except the pages that are accessing and displaying data load too slowly. I know it is difficult since I can not link to the actual app for anyone to see but I have included some of the code that I use below. I would love to get some insight as to how I can speed it up. It can take 10-15 seconds before the data is displayed. The page header graphic is shown but the rest of the page is blank until it loads.


***Index.html***

<div data-role="content">
<ul id="recent" data-role="listview" data-filter="true">
</ul>
</div>



***trnotesjsonxml.js***

(Pulls from XML file on the server and loads it into local database)
var db = window.openDatabase('trnotes', '1.0', 'Travel Notes',3*1024*1024);
db.transaction(function(t){
t.executeSql('DROP TABLE IF EXISTS notes');
// tx.executeSql('CREATE TABLE notes (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, address TEXT NOT NULL, option1 TEXT NOT NULL, option2 TEXT NOT NULL)');
t.executeSql('CREATE TABLE notes (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, title TEXT NOT NULL, category TEXT NOT NULL, description TEXT NOT NULL, image TEXT NOT NULL, restaurant TEXT NOT NULL, address TEXT NOT NULL, city TEXT NOT NULL, state TEXT NOT NULL, statelg TEXT NOT NULL, zip TEXT NOT NULL, phone TEXT NOT NULL, url TEXT NOT NULL, lat REAL, lng REAL)');

});


$.ajax({
type: "GET",
url: 'http://www.myserver.com/challenge.xml',
dataType: "xml",
success: parseXml
});




(Queries and displays the local data)
function getTitles() {
var list = $('#recent'),
items = [];
db.transaction(function(t) { //$.mobile.notesdb.transaction(function(t) {
t.executeSql('SELECT id, title, category FROM notes ORDER BY title ASC LIMIT ?', [trNotes.limit], function(t, result) {
var i,
len = result.rows.length,
row;
if (len > 0 ) {
for (i = 0; i < len; i += 1) {
row = result.rows.item(i);
items.push('<li><a href="#page3" data-trnote="' + row.id + '">' + '<strong>' + row.title + '</strong>' + '<br>' + row.category + '</a></li>');

}
list.html(items.join('\n'));
list.listview('refresh');
$('a', list).live('click', function(e) {
getItem($(this).attr('data-trnote'));
});
$('#entries').show();
} else {
$('#entries').hide();
}
})
});
}
0

#2 User is offline   Cjackson111 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 23-February 13

Posted 23 February 2013 - 03:46 PM

Sorry, forgot to mention that there are 430 records being saved from the XML file.
0

#3 User is offline   Cjackson111 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 23-February 13

Posted 25 February 2013 - 02:51 PM

What practices is everyone else doing to speed up their load time?
0

#4 User is offline   Cjackson111 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 23-February 13

Posted 25 February 2013 - 03:58 PM

As an alternative, is there a way to display a preloader on the page until the data is displayed? I just don't want the screen to be blank while it loads.
0

#5 User is offline   Indianic 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 26-December 12
  • Gender:Male
  • Location:India

Posted 09 March 2013 - 01:56 AM

Such a nice information. Thanks for sharing your experience about html 5.






Expert PHP programmers click here

This post has been edited by Indianic: 09 March 2013 - 01:57 AM

0

#6 User is offline   Ania Maclain 

  • New Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 30-March 13
  • Gender:Female
  • Location:Los Angeles
  • Interests:mobile apps design

Posted 01 April 2013 - 05:18 AM

Thanks for sharing this so nice one
The speed is depending on design of type dont put java script in in that is so nice for speed up to landing page...


Thanks and regards
Aania Maclain
http://www.pacificappdesign.com/
Ania Maclain from Los angeles working at http://www.pacificappdesign.com/index.html
0

#7 User is offline   Ania Maclain 

  • New Member
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 30-March 13
  • Gender:Female
  • Location:Los Angeles
  • Interests:mobile apps design

Posted 01 April 2013 - 05:22 AM

Thanks for sharing this so nice one



Thanks and regards
Aania Maclain

This post has been edited by Ania Maclain: 01 April 2013 - 05:23 AM

Ania Maclain from Los angeles working at http://www.pacificappdesign.com/index.html
0

#8 User is offline   addlinksites 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 22-April 13

Posted 22 April 2013 - 01:39 AM

loading time is very important in seo perspective. Thanks for sharing
Addlinksites is directory where you can add link and share articles.
[url="http://addlinksites.com"]link directory[/url] | [url="http://addlinksites.com/latest_links.php"]submit link[/url]
0

#9 User is offline   addlinksites 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 22-April 13

Posted 22 April 2013 - 01:41 AM

loading time is very important in seo perspective. Thanks for sharing
Addlinksites is directory where you can add link and share articles.
[url="http://addlinksites.com"]link directory[/url] | [url="http://addlinksites.com/latest_links.php"]submit link[/url]
0

#10 User is offline   iqbal51 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 31-July 11

Posted 27 May 2013 - 03:43 AM

Loading time is very important for a website. But I don’t know how can I use your code.
0

#11 User is offline   codrinsandu 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 09-December 13
  • Gender:Male
  • Location:Romania

Posted 09 December 2013 - 04:22 AM

That's a good speed up test, I need a similiar app for my website jocuri cu Barbie, for mobile version to speed up, and loading easy pages.
I like <a href="http://www.jocuribarbie.pw" >jocuri barbie</a>
0

#12 User is offline   pravin0123 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 18-October 14
  • Gender:Male

Posted 18 October 2014 - 10:34 PM

We all have faster version of windows 8 or 10 as latest coming into market. But the question is, do you know that you can improve the virtual PC speed and performance of your windows operating system to amazing speeds? then go we have to do that and make our PC's work more faster.
Its good to know about more technical topics easily then go with my about me.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users