How to use multitouch in Webworks app?

Hello!

After my first problems in the development of the app for BB in Webworks I still made my app. I have to use multitouch now, but I have no idea how. I did find samples with multitouch. I found only this: http://developer.blackberry.com/html5/apis/touchevent.html#targetTouches but I don't know how to use this function. Can you help me?

PS. Sorry for my bad English

And that's that

The following example is an implementation of filling of touch

I decided to leave the bind to the mouse in that it is probably useful to others

It is a living example of an ePub with blow gettures reader and touch

The code is a little complex, so I will answer any other than Gregs Qs

Basically what this did that target an iFrame and control

Anywhere you see a reference to my target frame - ignore it and replace with what you want to do

The hardest things to understand for the novice, here are the angle and the time (both are included)

Without much explain this sets @ high tell the manager what to do

A call to bindtouch (target) does what it says but is native, you must pass the name of the div tag

A binding triggers all important events

Angles and timing are still developing

Timing is crucial if you need one no doubt

Angle is optional and depends on how the finger is moved, but requires a JS call very expensive Math.atan2 (point1, point2)

Basically Angle you indicate where you moved your finger after the first touch so you can probably kill such things

The County touch gets the correct contact and doing what it takes with it based on defines it

Look - I told you it was very complicated

Oh - bind it to the mouse allows you to transfer the call to a mouse event - I thought it might be useful for other readers

The target an iFrmae is also very convenient as it is scrolling

I leave you for that suit your needs

function bindtouch (target) {}
var TOUCH_TAP_DIST = 30;
var TOUCH_TAP_TIME = 150;
var TOUCH_DRAG_DIST = 50;
var TOUCH_DRAG_TIME = 500;
var TOUCH_DRAG_VELOCITY = 50;
var TOUCH_SWIPE_DIST = 50;
var TOUCH_SWIPE_TIME = 500;
var TOUCH_SWIPE_VELOCITY = 75;

var SWIPE_NONE = 0;
var SWIPE_RIGHT = 1;
var SWIPE_UP = 2;
var SWIPE_LEFT = 4;
var SWIPE_DOWN = 8;

var _TOUCH_DRAG_VELOCITY = TOUCH_DRAG_VELOCITY * TOUCH_DRAG_VELOCITY;
    
var touch = [];

var el = target;

function squangle (p1, p2) {}
((p2.y-p1.y) return math.atan2, (p2.x - p1.x));
}

el.addEventListener ('touchend', Function {}
e.preventDefault ();
var TB = e.changedTouches;
for (var i = 0; i)
CTI var is ct [i] .identificateur;.
CTO var = ct [i];
{if (CTO. ClientX)}
Touch [sic] = {sx: cto.clientX,}
SY: cto.clientY,
TX: cto.clientX,
Ty: cto.clientY,
BX: cto.clientX,
by: cto.clientY,
PV: 0,
{TM: e.timeStamp};
var id = "#tch" + ct;
                
evt var = document.createEvent ("MouseEvents");
evt.initMouseEvent ("mousedown", true, true, window,
0, cto.screenX, cto.screenY,.
cto.clientX, cto.clientY, false, false, false, false, 0, null);
e.srcElement.dispatchEvent (evt);
}
}
});

el.addEventListener ('touchmove', Function {}
e.preventDefault ();
var TB = e.changedTouches;
for (var i = 0; i)
CTO var = ct [i];
TCO var = touch [cto.identifier];
var ms = e.timeStamp - tco.tm;
{if (CTO. ClientX)}
TCO. TX = cto.clientX;
TCO. Ty = cto.clientY;
TCO. PV = Math.sqrt (((tco.sx-tco.tx) * (tco.sx - tco.tx)))
+ ((tco.sy-tco.ty) * (tco.sy - tco.ty)));
if(e.touches.Length == 2) {}
dreadful var = e.touches.length;
}
if(e.touches.Length == 1) {}
var dx = Math.abs(tco.bx-tco.sx);
var dy = Math.abs(tco.by-tco.sy);

If (tco.pv< _touch_drag_velocity)="">
If ((smode == SCALE_ZOOM) & (fsize > 1.00)) {}
$(frames['appframe'].document).scrollLeft ($(frames['appframe'].document).scrollLeft () + (tco.sx - tco.tx));
//                            }
EB var = $(frames['appframe'].document);
St var = eb.scrollTop ();
$(frames['appframe'].document).scrollTop (st + (tco.sy - tco.ty));
.SX Touch [i] = e.touches [i] .clientX;
.Sy Touch [i] = e.touches [i] .clientY;
}
}
                
TCO. SX = cto.clientX;
TCO. Sy = cto.clientY;
}
}
});
            
el.addEventListener ('touchstart', Function {}
e.preventDefault ();
var TB = e.changedTouches;
for (var i = 0; i)
CTO var = ct [i];
TCO var = touch [cto.identifier];
var ms = e.timeStamp - tco.tm;
var dx = Math.abs(tco.bx-tco.sx);
var dy = Math.abs(tco.by-tco.sy);
evt var = document.createEvent ("MouseEvents");

If ((dx< touch_tap_dist)="" &&="" (dy="">< touch_tap_dist)="" &&="" (ms=""><= touch_tap_time))="">
evt.initMouseEvent ("click", true, true, window,
0, tco.sx, tco.sy, tco.sx, tco.sy, false, false, false, false, 0, null);
e.srcElement.dispatchEvent (evt);
}
ElseIf (((dx > TOUCH_SWIPE_DIST) |)) (dy > TOUCH_SWIPE_DIST)) & (Mrs.<= touch_swipe_time))="">
if(DX > TOUCH_SWIPE_DIST) {}
If (TCO. BX > TCO. SX) {}
swipex = SWIPE_RIGHT;
}
else {}
swipex = SWIPE_LEFT;
}
}
else {}
swipex = SWIPE_NONE;
}
                    
if(dy > TOUCH_SWIPE_DIST) {}
if(TCO.by > TCO.) SY) {}
swipey = SWIPE_UP;
}
else {}
swipey = SWIPE_DOWN;
}
}
else {}
swipey = SWIPE_NONE;
}
                    
If ((swipey == SWIPE_NONE) & (swipex == SWIPE_RIGHT))
{
switchPage (1);
}
If ((swipey == SWIPE_NONE) & (swipex == SWIPE_LEFT))
{
switchPage(-1);
}

evt.initMouseEvent ("mouseup", true, true, window,
0, tco.sx, tco.sy, tco.sx, tco.sy, false, false, false, false, 0, null);
e.srcElement.dispatchEvent (evt);
}
else {}
evt.initMouseEvent ("mouseup", true, true, window,
0, tco.sx, tco.sy, tco.sx, tco.sy, false, false, false, false, 0, null);
}

}
});
}

Tags: BlackBerry Developers

Similar Questions

  • How to get the Blackberry ID using javascript for Webworks App?

    Hi all

    I have developed a web application using Blackberry webworks SDK and emulator Ripple... Here, I need to get the Blackberry device ID using javascript... Please me... Thanks in advance...

    With respect,

    Marimuthu_P

    HM... There is a sample to get the PIN with javascript.

    https://developer.BlackBerry.com/HTML5/APIs/BlackBerry.identity.html#.UUID

  • Use of BarCode WebWorks App extension attempt

    I have configured the extension of the barcode thus:

    The library.xml is located in C:\Program Files (x 86) \Research In Motion\BlackBerry WebWorks SDK 2.3.1.5\ext\webworks.media.barcode

    Files in directory and java UI are in C:\Program Files (x 86) \Research In Motion\BlackBerry WebWorks SDK 2.3.1.5\ext\webworks.media.barcode\webworks\media\barcode

    The app config.XML looks like this:


    http://www.w3.org/ns/widgets"xmlns:rim ="http://www.blackberry.com/ns/widgets"version ="1.0.0.0">"
      Soldier Barcode App
      DemoBarCode illustrates the native use of barcode libraries within the BlackBerry Application.
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    When I try to package this I get the following error:

    C:\Program Files (x 86) \Research in Motion\BlackBerry SDK WebWorks 2.3.1.5 > bbwp C:\UID\SMBA\SoldierBarcodeAppTOSIGN.zip o C:\UID\SMBA\output
    [INFO]                  Parsing of the command line options
    [INFO]                  Bbwp.properties analysis
    [INFO]                  Validation of archive application
    [INFO]                  The analysis of config.xml
    [WARNING]               Can't find the item of
    [INFO]                  The application of filling source
    [Fatal error] library.xml:16:6: matching the target processing instruction "[xX] [mM] [he's]" is not allowed.
    [ERROR]                 Feature is not found in any extension (webworks.media.barcode)

    Help!

    I found that the problem was caused by the expansion webworks.media.barcode library.xml file.   The comments before thetag.  When I moved thetag of the first line of the file everything worked.

    Thanks to Jeff Bentley RIM to help resolve this problem.

  • How to use admob on my apps?

    Hello

    I know almost nothing about the code and let me know if there is a 'step by step' admob to my apps integration guide. Or if theres another way to monetize my apps.

    I'd appreciate your help.

    Hi Paul,.

    Best is to use is the dairy extension Admob native games, it's really good... This works for Android and iOS apps.

    Its easy to integrate in the AS3 code and is well supported by e-mail... .the documentation provided in fact easy to put in place...

    There are alternatives to Admob, but they don't usually have as good geographical coverage, although some pay a little more.

    Vserv.mobi (from Mumbai, India) deserve to be looking - they provide a simple tool of "" Wrapper Ad"for android that puts the interstitial ads at the beginning and end of each app without code being necessary at all. Vserv is good for Asian markets, particularly for China because it does not have any Google code which is prevented from China app store (even on the Samsung). My experience of Vserv is a good one with good support and reliable payment... It complements money admob nicely...

    I hope this helps...

  • How to use sharing of family - app still ask for money

    I configured a family arrangement of sharing and that my wife as the only other Member.  I want to install an app on his iPad I have on my iPhone.  The app info indicates that it is eligible for family sharing.  However, when I find the app in the App Store, it displays the buy"" button.  I don't want to pay for it again, as I understand it is that the sharing of the family bit was all about.  Something I'm missing here?  Something will catch the purchase if I click on the button "buy"?

    Here are a few thoughts from the Apple site that can help...

  • Re: How to use webcam on Satellite C50?

    I just bought a C50 and may not know how to use the webcam.

    Can someone help me please?

    DJ.

    You have your laptop with preinstalled OS or you try to use it with your own version?
    I ask this question because if you have your laptop with OS preinstalled you can use Cam Windows application.

    How to use it on that you can read
    Help app and webcams camera
    How to use Windows 8 camera App

    Check it out.

  • Add WebWorks App to share the map

    Dear community,

    How can I add my Webworks App for the ShareCard?

    I want exaclty:
    I want to 'share' link from the browser native of my application, but I can't find a solution how to add my application to share the maps.

    Someone knows how to do this?

    I believe that this sample application shows how to do this.

    https://github.com/BlackBerry/BB10-WebWorks-samples/tree/master/invocation

    Above all, you will be interested the app "Remained" in this repo.

  • How do I send the email from BB10 webworks app

    I want to have a module in my BB10 WebWorks app that will allow users to compose a message by entering the information in a form, which will then be sent by e-mail to an e-mail address.

    I guess this could be done by using the EmailComposerOptions API, but I don't know how to use it.

    Any help will be appreciated.

    Have you looked at the code example in the API document?

    https://developer.BlackBerry.com/HTML5/APIs/BlackBerry.Invoke.card.html#.invokeEmailComposer

    < script="text/javascript">
    //simply invoke email composer, with no options and callbacks
    blackberry.invoke.card.invokeEmailComposer();
    
    //invoke email composer with subject, body, to, cc and attachment options
    blackberry.invoke.card.invokeEmailComposer({
        subject: "Email subject",
        body: "Email body",
        to: ["[email protected]", "[email protected]"],
        cc: ["[email protected], [email protected]"],
        attachment: ["/path/to/an/attachment.txt", "path/to/another/attachment.txt"]
    }, function (done) {
        console.log(done);
    }, function (cancel) {
        console.log(cancel)
    }, function (invokeError) {
        console.log(invokeError);
    });
    
    

    Once the function is called, map of composer email will slip into the view with all pre-filled fields and the user can then click on send.

  • How to adapt the start screen on all webworks App blackberry blackberry devices?

    I'm working on blackberry webworks app targeting blackberry 7 & lower OS versions. I have a 360 x 480 pixels boot image that adapts perfectly to the BlackBerry curve Smartphone 9380. But the same splash image does not fit into other devices with different screen sizes. So, now I have created the home screen with a different resolution. But I don't know how to use it? Can someone like me how to select the splash screen dynamic based on the resolution of the device or other means to solve this problem?

    Unfortuantely on BBOS, you can have a single element of the rim: loadingScreen:
    http://developer.BlackBerry.com/BBOS/HTML5/documentation/rim_loadingscreen_element_834680_11.html

    Whereas the BB10, you can have several elements of the rim: splash that the device would automatically take the best resolution of.

    Because it is a property of config/xml, there is no way to dynamically assign values. You would need a separate for each loadingScreen dimensions version.

  • Using JSR 172 stubs in WebWorks app

    Hello
    I'm new to webworks. I need to know how to access the webworks app webservices. I have a .net Server, and I created the stubs using JSR172. Now, I need to know how to use those heels in Webworks BB applications. Extension of JavaScript is a solution? If so, how to convert my heels as Extension of Javascript?

    Thanks in advance...

    Creating a script JavaScript extension for stubs will be complicated and is not portable to other platforms or the PlayBook.

    There are some examples out there how to call a web service SOAP directly via JavaScript and AJAX.  Here are just a few examples

    http://www.TechRepublic.com/article/easily-consume-SOAP-Web-services-with-JavaScript/5887775

    http://javascriptsoapclient.codeplex.com/

  • How to run or pass local webworks app through ripple?

    How to run or pass local webworks app through ripple?

    Do not click on 'Enable' to ripple extention if my files in the local file system.

    You can use the local file system for waving as well, but you must do this:

    -Open Chrome settings

    -Click on Extensions

    -Select the ripple

    -Check 'allow access to the URL of the file.

  • Call another internal App using WebWorks App

    Hello

    Is there a way I can call it an installed application (not specific playbook) of my webworks app? Something similar otherwise call functionality. Clues on how to invoke an application in a similar way? No API for the same will be available in the near future?

    Thanks in advance

    Praveen

    You can call a 3rd another application of part on the smartphone BlackBerry using the JavaArguments.  On the PlayBook, you can only call the applications listed in the API to invoke.

    http://www.BlackBerry.com/developers/docs/WebWorks/API/BlackBerry.Invoke.JavaArguments.html

    I don't know when they will import this feature for the PlayBook.

  • How to use the apps to iTunes on macbook?

    How to use an app from iTunes on my macbook? (like snapchat) It worked for my friend, but he won´t works for me...

    iOS applications cannot be run on a computer.

    (142286)

  • How to use mobile data for large app download data

    How to use mobile data for large app download data

    How can I set big data

  • How to identify a webworks app launches for the first time...

    I am designing my webworks app to prompt the user to accept a license agreement before using the application for the first time. If they accept that the application works as usual, if they decline the application does not load and it ends.

    Is to do it in a Webworks app without the use of a store like the SD card anyway?

    I don't want to use the SD card as a store because it limits the number of users who can use the app (even if these SD cards are now pretty much standard).

    Does anyone have any suggestions?

    EC

    You can store the information using the API file on the local file system IO... You don't need to use the SD card... just a local path on the file system of the device.

Maybe you are looking for

  • Is there a limit to how many staff (mine) email addresses can I have?

    I just download Thunderbird and have configured the my email but as I have 4 staff email address it dose does not accept all. Also our mail should go to mail.wanderer.com.au and mail must go to mail.amnet.net.au is this a problem? Thunderbird, allowe

  • problem syncing iCloud: Photos on Mac OS x, do not sync with the iPad, iPhone

    I pay 200 GB of storage iCloud, available are still 139 GB. My photo library is 93,25 GB in size. While my two iPhone6 and my iPad seem to be reasonably in sync, the photo library on my MacBook Pro is anything but in phase: there is an inconsistency

  • Milanese and buckle brown leather + race

    Hello I have a question for users of AW with Milanese or buckle brown leather. It is convenient to run with these two bands? You see signs of wear, especially in the loop (reaction to sweat) leather? Let me put it this way: agree the Milanese loop an

  • BSOD on Virtual Server 2008 R2

    Hey,. I have a server that has been crashing for 2 months now. I can't understand what is happening with this server. Can someone help me? Ran Verifier: server has ever planted started upward. Tried to remove the old drivers of the printer. At ran wi

  • Issuw with Windows Media Player libraries.

    Hey everybody, I recently replaced my Xbox 360 with an Xbox-especially that I like the Media Center of the things, I have the XboxOne added as a UPNP to Play streaming device that seems to work great. Now my problem is seen of Windows Media Player 12