API to Httpurlconnection in BlackBerry

I am looking for an API to connect to some other destination (URL) to extract the content and display it in the mobile client. I had things like connector, HttpConnection of J2ME. Y does it have any similar API is available from BlackBerry

I hope this helps.

.

Thanks in advance,

Barry.

Please check the 'httpdemo' comes with JDE. A very good example to start with.

You have to visit this thread.

http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&thread.ID=29103

PS: Added URL.

Tags: BlackBerry Developers

Similar Questions

  • How to work on the Api payment Service in blackberry

    Hello

    I was creating an application to OS 5.0 with name AppPack. I had added the paymentapi jar file to it. The project to build successfully and as I open the app in the Simulator displays a dialog box with the following error

    «Error starting AppPack: error in the Module ' paymentapi;» not found ".

    I had downloaded this Internet payment service. Please help me to solve this error.

    Thanking you in advance!

    -Sam

    If you are using eclipse:

    1. in the course of your project, good clip--> go to properties

    2. build path Java

    3. Add the libraries

    4. add some external jars (add all the jars you need)

    5. go to the tab "order and export.

    6 and select all the pots you add.

    PS: Sorry for my English.

  • Bug in the API BES12 setUsersActivationPassword?

    Hello corporate developers!

    While preparing our migration of the device from BES10 to BES12, I've developed some tools with the Web services of BlackBerry BES12.1.1. Everything is running, but I have a problem with the generation and sending of a random activation using the API password "setUsersActivationPassword".

    I call the API and users receive the activation password and user BES12 interface indicates the period of activation as expected. All right, BUT...

    The issue is the registration of the e-mail address of the user with the ID of the PRS in the BlackBerry Infrastructure to allow Enterprise activation simple and straigth forward on the BlackBerry.

    My Java method to manage demand for Activation password and logs:

    private static boolean generateActivationPassword(String accountName, com.rim.ws.enterprise.admin.User user) {
            final String METHOD_NAME = "generateActivationPassword()";
            final String BWS_API_NAME = "_bws.setUsersActivationPassword()";
            logMessage("Entering %s", METHOD_NAME);
            boolean returnValue = false;
    
            SetUsersActivationPasswordRequest request = new SetUsersActivationPasswordRequest();
            request.setMetadata(REQUEST_METADATA);
            // request.setExpiryHours(24); // wird mit Standard = 48 überschrieben
            request.getUsers().add(user);
            request.setGenerateAndEmailRandomPassword(true);
    
            SetUsersActivationPasswordResponse response = null;
            try {
                logRequest(BWS_API_NAME);
                response = _bws.setUsersActivationPassword(request);
                logResponse(BWS_API_NAME, response.getReturnStatus().getCode(), response.getMetadata());
            } catch (WebServiceException e) {
                // Log and re-throw exception.
                logMessage("Exiting %s with exception \"%s\"", METHOD_NAME, e.getMessage());
                throw e;
            }
    
            if (response.getReturnStatus().getCode().equals("SUCCESS")) {
    
                if (response.getIndividualResponses() != null) {
                    for (IndividualResponse individualResponse : response.getIndividualResponses()) {
                        logMessage("Message: %s (Code: %s)", individualResponse.getReturnStatus().getMessage(), individualResponse.getReturnStatus()
                                .getCode());
                        logMessage("Request UID: %s", individualResponse.getUid());
                    }
    
                    returnValue = true;
                }
    
            } else {
                logMessage("Error Message: \"%s\"", response.getReturnStatus().getMessage());
    
                if (response.getIndividualResponses() != null) {
                    for (IndividualResponse individualResponse : response.getIndividualResponses()) {
                        log.error(String.format("Individual Response - Code \"%s\", Message: \"%s\"", individualResponse.getReturnStatus().getCode(),
                                individualResponse.getReturnStatus().getMessage()));
                    }
                }
            }
    
            logMessage("Exiting %s with %s", METHOD_NAME, returnValue);
            return returnValue;
        }
    
    28.07.2015 14:07:27,116 DEBUG : Entering generateActivationPassword()
    28.07.2015 14:07:27,116 DEBUG : Calling _bws.setUsersActivationPassword()...
    28.07.2015 14:07:29,241 DEBUG : ..._bws.setUsersActivationPassword() returned "SUCCESS"
    28.07.2015 14:07:29,241 DEBUG : Execution Time: 0,7531 seconds
    28.07.2015 14:07:29,241 DEBUG : Request UID: b7963c52-a841-419a-976b-05597583d6b2
    28.07.2015 14:07:29,241 DEBUG : Message:  (Code: SUCCESS)
    28.07.2015 14:07:29,241 DEBUG : Request UID: a95f7e29-6388-4b97-bb3a-96645f516255
    28.07.2015 14:07:29,241 DEBUG : Exiting generateActivationPassword() with true
    

    Is there no workaround solution for the registry API information with the BlackBerry infrastructure? Am I doing something wrong or miss some peace of code here?

    Thanks for helping!

    Greetings from the Germany,

    Daniel

    P.S.: Generate a password for the user BES12 interface saves the data in the infrastructure properly!

    It isn't a fix available for this today.  You are a subscriber to BlackBerry TSupport?  If so, I recommend there curious to see if this would be possible.

  • How do we get the device phone number using webworks api 2.0

    I could see an example of code to get the phone number of javascript which is not supported for BB10.  The code below does not work for BB10? If so, what is one alternative to the native extension.

    
    

    Hi beats,

    It is currently not possible. The only way you could get the phone number in this moment is to create a native extension that accesses the 'phone' / 'Line' API here http://developer.blackberry.com/native/reference/cascades/bb__system__phone__line.html?f=line#functi...

  • Graphic design using google chart api but does not

    Hello everyone, I want to create a line graph using google api in my appliction of blackberry, for this I downloaded "blackberry-google-chart-api" and referring to this link:

    "https://code.google.com/p/blackberry-google-chart-api/source/browse/trunk/blackberry-google-chart-ap... ".

    but it gives me the class not found exception.

    Do not know how to solve this issue... Thank you...

    Thanks vishakhaYadav10 & peter strange, my problem is solved with the following solution: -.

    String [] pointArray = (String []) hashtable.get ("point");

    "String url ="http://chart.apis.google.com/chart?&cht=lc&chco=000000&chds=0, 10 & chdlp = b & chxt = x, y ' +.
    "& chg = 1.04, 0, 5, 1 & CHD = 0, 30 & chco = 3072F3, ff0000, 00aaaa & chls = 2, 4, 1 & chm = s, FF0000, 0, -1, 0 | s, 0000ff, 1, -1, 0. s, 00aa00, 2, -1, 0 +.
    "& chs = 480 x 280 & splash = validate & chd = t:100, 200, 300, 400, 500, 600, 700 & chd = t: ';

    for (int i = 0; i)<>

    {

  • Sign up for the service push BlackBerry 10

    Hello

    I'm trying to implement the blackberry for BB10 push notification.

    I have camera z10. My device doesn't have a sim card. I use internet through Wi - Fi.

    When I call the function below is to show some mistakes. 'blackberry.push.openBISPushListener '.

    Please let me know, for recording in the push notification service, if the Sim Card and BIS are necessary or not.

    Please help me.

    The API you noted (openBISPushListener) is a Legacy BBOS API for BBOS 5.0 - 7.1

    For BlackBerry 10, you will need to take advantage PushService.create approach:
    https://developer.BlackBerry.com/HTML5/APIs/beta/BlackBerry.push.pushservice.html

    Direct API documentation:
    https://developer.BlackBerry.com/HTML5/APIs/beta/blackberry_push_PushService_create.html

    EDIT: Push via WiFi is completely valid.

  • BlackBerry.utils does not properly

    Blackberry.utils package does not work as described in the last SDK WebWorks.

    First, the space of names so that it won't, according to documentation, it should be Blackberry.utils, but it's actually just "Utils" (at least for me). Bar package manager can not find a feature with the id "blackberry.utils" unless you manually change the manifest to say "blackberry.utils" instead of just "utils".

    But even in this case, missing funtions as blackberry.utils.stringToBlob.

    For this reason I cannot create/save/load files using the SDK WebWorks, is this a problem on my end or there at - it something wrong with this version of the SDK? (I already tried to reinstall)

    Ah yes, that would explain then. The Utils API is not available on BlackBerry 10:
    https://developer.BlackBerry.com/BBOS/HTML5/APIs/BlackBerry.utils.html

    It was available on BBOS and PlayBook. If we check the BB10 docs, it is more listed in the API reference:
    https://developer.BlackBerry.com/HTML5/APIs/

    To save/load/create the files using the SDK software BlackBerry 10, we now have the HTML5 Filesystem APIs, which shouldn't require the Utils APIs:
    https://developer.BlackBerry.com/HTML5/APIs/BlackBerry.IO.html

  • Cannot load the blackberry.launch.newSMS text

    IM using blackberry.launch.newSMS to launch an sms, but my body text cannot load in the machine.

    blackberry.launch.newSMS({ 'number':'123456', 'text':'my texts body'});
    

    Can someone help me?

    Hello!

    No matter what reason, why you do not use the SMS API? https://developer.BlackBerry.com/HTML5/APIs/BlackBerry.message.SMS.html

  • [Issue] How data is transferred when you use BlackBerry (NFC) Tag? WiFi Direct? Bluetooth 2.1? Bluetooth 3.0?

    Hello

    I saw a bunch of videos of demonstration of tag BlackBerry of all the cool things you can do with the NFC, but it wondered, what happens if all my other antenas wireless, WiFi and Bluetooth, are out of?

    NFC can be used to transfer data, but it is not good for large quantities. I looked a little further and I found this cool video showing the difference to use Bluetooth 2.1, Bluetooth 3.0 high speed and Wifi Direct to transfer large files, such as videos. BB10 already does support Wifi Direct? Bluetooth 3.0 high speed?

    I hope that BB10 supports ALL the performance and maximum compatibility.

    I don't know where to post this question so here's. Please move was a better place. I think that the community needs a session of general development for wider issues.

    See you soon!

    Hello

    Tag BlackBerry, and the APIs available for developers will automatically perform the best way to transfer the data. NFC supports something called "connect transfer" and are the largest payloads or certain types of data (photos, for example) rather than by peer-to-peer NFC, NFC mode data transfer is just used to negotiate alternative transport. In the case of the BlackBerry smart phones, this alternative will be bluetooth.

    For users of touch devices, there is a brief 'conversation' between the devices on the NFC and this translates into a bluetooth connection set up and data transfer initiated through the bluetooth connection faster. This is all without the usual matching process. After reaching the stage of bluetooth devices need closer will be of course.

    The same principle applies to both 7 BlackBerry and BlackBerry 10. In fact talk us a bit about this in our latest article on BlackBerry 10 NFC API:

    http://supportforums.BlackBerry.com/T5/native-development/BlackBerry-10-sharing-using-NfcShareManage...

    I hope this helps.

    For more information on see NFC:

    http://supportforums.BlackBerry.com/T5/Java-development/NFC-article-and-code-index/Ta-p/1538775

  • Call the JavaScript file java class in the native blackberry development.


    What you are looking for is the ScriptableFunction class.

    You can extend the script engine of a JavaScript object name to a ScriptableFunction Java class mapping.  In this example, if you called foo. JavaScript bar(), the BrowserField would facilitate a call to the invoke() method defined in the MyScriptableFunction() class:

    protected BrowserField _browserField   = null;
    _browserField = new BrowserField();
    _browserField.extendScriptEngine("foo.Bar", new MyScriptableFunction());
    

    Then you set your ScriptableFunction class like this and fill it with some Java code, you need.  Note: it only accepts strings as input parameters.

    import net.rim.device.api.script.ScriptableFunction;
    
    /**
     * @description Demonstration of using the ScriptableFunction class added to version 5.0 of the BlackBerry Device
     *              Software
     * @version 1.0
     * @author Adam Stanley, Developer Relations
     * @category BlackBerry BrowserField Development: ScriptableFunction API
     * @see http ://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/script/ScriptableFunction .html
     */
    
    /**
     * This class can be used to represent a function in the JavaScript environment.
     */
    public class MyScriptableFunction extends ScriptableFunction
    {
    
        /**
         * User has invoked this ScriptableFunction from the JavaScript engine This example shows how to open the Messages
         * application and create a new message
         */
        public Object invoke(Object obj, Object[] args) throws Exception
        {
            if (args.length == 3)
            {
    
                String param1 = args[0].toString();
                String param2 = args[1].toString();
                String param3 = args[2].toString();
    
                //Do something
            }
            return Boolean.TRUE; //Always
        }
    
    }
    

    Hope that helps.

  • HTML5 Micro API NullPointerException Bug.

    From what I can tell, the program for the microphone API example - https://developer.blackberry.com/html5/apis/blackberry.media.microphone.html

    will have always a NullPointerException uncaught on function "RecordPlayer.writeSavedData ()" line: 1197 when you use Blackberry JDE 7.1.0. Still saves the file, it will first the exeption. I tried on an earlier version 6.0.0 and it worked fine. I heard that he even worked on 7.0.0. Does anyone know a solution to this? I think it's a bug, or it may just be a problem with the code example.

    I finally managed to find that it was a section of the code of the function 'stop' in Record.java. I don't know if that would break some functions of the Microphone API, but I just commented on it:

    Stop recording, close the OutputStream and player.
    / * If (_rcontrol! = null) {}
    try {}
    _rcontrol.commit ();
    } catch (IOException e) {}
    MicrophoneNamespace.handleError (_errorCallback, e);
    }
    _rcontrol = null;
    }*/

    I don't know how he was throwing a NullPointerException, but without this article, the code works perfectly fine.

  • Please tell me the API reference...

    I guess I should have opened a new message.

    I am a developer and have completed my proof of concept and my program runs on a Blackberry Simulator.  I have to 'listen' calendar to provide the user with the data of another day as "today".

    Where is the 'API Reference for the BlackBerry Java Development Environment'?  I searched and searched, I know it's somewhere obvious, but I can't.

    Austin

    If I understand correctly you need something like this: Documents

    In fact, it is not clear what information you need to get calendar, but in any case, I guess, classs PIM and PIMListListener should be used.

  • users in the BES?

    Hi, I want to know if there is anything to access users colour list the BES to?

    There are two ways you could get access to it.

    BlackBerry administration api

    http://docs.BlackBerry.com/en/developers/deliverables/16632/Understanding_the_BB_Admin_API_835452_11...

    Or the Resource Kit for BlackBerry - using the client/server tools

    http://docs.BlackBerry.com/en/Admin/subcategories/?usertype=2&category=BlackBerry+Enterprise+Server+...

  • Get the device ID in the BpsSubscriptionMessageBuilder.createByteSubscriptionMessage method

    Hi all,

    First of all, sorry if this thread is not appropriate because there is a similar. If there is, I have not found.

    I want to build an application compatible with its server push, but I don't want to use servlets and the jar provided by push SDK service.

    I think that the only thing I have to do in the server part is to get the PAP message with the required parameter 'address' (the device) using low level libraries.

    However, I have a problem of developing the application in the device. Using this code as a reference:
    http://docs.BlackBerry.com/en/developers/deliverables/21128/Subscribe_to_a_BPS_content_provider_1226...

    I see that the parameter 'address' is obtained in the createByteSubscriptionMessage method, but I don't see its implementation to get the parameter 'address' (got to the servlet subscription) because it is a native method.

    Thus,.

    1 - see the API:

    http://www.BlackBerry.com/developers/docs/7.0.0api/NET/rim/device/API/IO/messaging/BpsSubscriptionMe...

    What is the parameter 'address' obtained in the server (servlet subscription) part? The device ID? How can I get it back?

    2 - I could build the app-client just stay at step 6 and send the HTTP message on my way?

    Can someone help me?

    Thank you all.
    Kind regards.

    If I understand what you're trying to ask is how to get the address of the device your application to initiator to push aside server.

    If so, you can see an example here:

    https://developer.BlackBerry.com/Java/documentation/registering_to_receive_push_messages.html

    Basically, you can see the code example in the sample application compatible push built a HTTP message to send to its application server-side. Although this example sends the HTTP message in the format SDK expects that you don't need to use the SDK or the same format, but you can follow the example to send a simple HTTP message on your own server to send the information about your application requires server-side. For example, the link above shows that to get the address of the device, you can do this:

    Integer.toHexString( DeviceInfo.getDeviceId() )
    

    In side your application server, you must save the address of the device, then when you build the push request message that you use as the address of the device if you are using the low level SDK APIs (or enter this value in the field address PAP XML if not not using the SDK).

  • Where to start webwrks

    Hi all

    one you suggest from where I should start webworks!

    I am very new to this!

    Thank you

    Sahil

    Probably best to start with the getting started guide: https://developer.blackberry.com/html5/documentation/what_is_a_webworks_app_1845471_11.html

    Then keep (https://developer.blackberry.com/html5/documentation/ ) documentation and the api reference (https://developer.blackberry.com/html5/apis/) handy.

    Search the forums when you have problems and ask questions if you are confused!

    R

Maybe you are looking for