Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Developer
Posts: 3
Registered: ‎03-03-2014
My Device: 9360 (Developer)
My Carrier: Vodafone

Application not working using blackberry.net

  Whenever I am trying to access application, keeping  APN  www/portalnmms , and trying to access the application and it works absolutely fine,Also working fine in Wi-Fi.

while I am using blackberry.net APN (Vodafone SIM) application not working and giving error "Connection Time Out".

Here Is My Javascript Code...

 

Thanks in Advance.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
<script src="js/Blackberry.js" type="text/javascript"></script>
    <script src="js/jquery-1.9.1.min.js"></script>
    <script src="js/webservicecall.js" type="text/javascript"></script>
    <script src="js/cordova-2.4.0.js"></script>

    
    <script type="text/javascript">
                alert("this is Image Page");
		var siteid="IN-1111"
		var step="1";
 		var i_c="2";
 		var check="3";
 		var ques_id="4";
        // Called if something bad happens.
        //
          function OK() {

            try {
               // loading();
             alert(ImageURL);
                uploadPhoto(ImageURL);
            } catch (e) {
                //loading_hide();
                alert('An error has occurred: ' + e.message);
            }

        }

        function agincapture() {
            capturePhoto();
        }

        function Cancel() {

            $("div#pop-up").css("display", "none");
            $("div#divcontent").css("display", "block");
        }

        // Called if something bad happens.
        //
        function onFail(message) {
            loading_hide();
        }

        function CaptureClick(btn) {
            alert(btn);
            ques_id = btn;
            capturePhoto();
        }


        function onFail(message) {
            alert(message);
        }

        function uploadPhoto(imageURI) {

            try {
                var options = new FileUploadOptions();
                options.fileKey = "file";
                options.fileName = imageURI.substr(imageURI.lastIndexOf('/') + 1);
                options.mimeType = "image/jpeg";
		alert("hello");
                var params = new Object();
                params.value1 = "test";
                params.value2 = "param";

  		params.siteid = siteid;
 		params.stepid = step;
 		params.inspection_counter = i_c;
 		params.check_type = check;
 		params.ques_id = ques_id;
alert(ques_id);
                


                options.params = params;
                options.chunkedMode = false;
                var ft = new FileTransfer();
alert("ft"+ft);
                // ft.upload(ImageURL, "http://221.135.134.190:9898/vodaciat_phonegap.php?siteid=" + siteid + "&stepid=" + step + "&inspection_counter=" + i_c + "&check_type=" + check + "&ques_id=" + ques_id, win, fail, options);
                ft.upload(ImageURL,"http://ptwtesting.skyproductivity.com/Services/JSONP/MyService.asmx/UploadAudio", win, fail, options);
alert('end1');
                return false;
            } catch (e) {
                //loading_hide();
                alert('An error has occurred:' + e);
            }
        }

        function win(r) {
           // loading_hide();
alert(JSON.stringify(r));
            $("div#pop-up").css("display", "none")
            $("div#divcontent").css("display", "block");
        }

        function fail(error) {
            //loading_hide();
            alert(JSON.stringify(error));

        }

        function capturePhoto() {
           // loading();
            navigator.camera.getPicture(onPhotoDataSuccess, onFail, {
                quality: 60,
                targetWidth: 200,
                targetHeight: 200
            });
        }

        function onPhotoDataSuccess(imageData) {
           // loading();
            console.log("---> Image: " + imageData);

            var smallImage = document.getElementById('smallImage');

            smallImage.style.display = 'block';

            ImageURL = imageData;
            smallImage.src=imageData;
           // loading_hide();
            $('div#pop-up').css("display", "block");
            $("div#divcontent").css("display", "none");
            Resize();
        }

    </script>
</head>
<body>
    <input type="button" value="camera" onclick="CaptureClick('1')" />
 <div id="pop-up" style="display: none">
                        <div id="divimag">
                            <img id="smallImage" src="" style="display: none" />
                        </div>
                        <div id="divbtn">
                            <button id="btnok" onclick="OK(); return false;">
                                OK
                            </button>
                            <button id="btncapture" onclick="agincapture(); return false;">
                                Re-Capture
                            </button>
                            <button id="Button1" onclick="Cancel(); return false;">
                                Cancel
                            </button>
                        </div>
                    </div>
</body>
</html>

 

 

 

 

Highlighted
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: Application not working using blackberry.net

Can you access any online content (i.e. using the device browser, etc.) on the new APN? Are you certain that SIM Card is provisioned fully for data? (i.e. not just BIS data, etc.)

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.