Minibook with bookmark

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jorgecaballero
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 32
Joined: Mon Nov 26, 2012 6:07 pm

Minibook with bookmark

Post by jorgecaballero » Wed Dec 19, 2012 6:57 am

I am creating small books for mobile, Android and IOS but I want to bookmark for readers to continue reading later,
anyone have an example or something that can help me?

Thanks, I await your response.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Minibook with bookmark

Post by Mark » Wed Dec 19, 2012 4:04 pm

Hi,

Make a button that stores the current position in the text (this could be a particular line number in the text or a card ID, depending on how you have set up your app) in a file (e.g. specialFolderPath("documents") & "/bookmarks.dat").

When the app opens, display all bookmarks in a field and let the user click or tap on that field to choose a bookmark.

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jorgecaballero
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 32
Joined: Mon Nov 26, 2012 6:07 pm

a bettrt way,,, Re: Minibook with bookmark

Post by jorgecaballero » Wed Dec 19, 2012 6:29 pm

Thanks for your answer,

I am a beginner, I hope you have some example that can help me, I would greatly appreciate it.

As I'm doing, is I put text fragments in different stacks and to move between them using buttons,
tell me if you have a better way to make a little book for Android and iPhone and also able to use bookmarks.

I have a project of short stories with my daughter and I want to see it come true.

a hug.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Minibook with bookmark

Post by Mark » Wed Dec 19, 2012 9:25 pm

Hi,

First of all, if you're going to make a relatively simple e-book, i.e. something that isn't an adventure game and doesn't have many interactive features, Apple isn't going to accept it. Apple will tell you to use iBooks Author and to submit your work as an e-book rather than an app. AFAIK there are no such restrictions for the Android market.

You could keep a list of bookmarks like this:

Code: Select all

on mouseUp
  ask "Enter a description for this bookmark..."
  if it is not empty then
    put it & numToChar(14) & the id of this cd into myBookmark
    set the cBookmarks of this stack to the cBookmarks of this stack & cr & myBookmark
    put the cBookmarks of this stack into url ("binfile:" & specialfolderpath("documents") & "/bookmarks.dat")
  end if
end mouseUp
Now you only need to figure out how to show all bookmarks in a list and make this list respond to mouseUp messages. Hint: you need to set the itemDel to numToChar(14) to be able to retrieve item 2 of the selectedText of a list field.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply