Android Example [Inline Java] Get The Method Name

Discussion in 'Tutorials & Examples' started by Jaames, Mar 7, 2015.

  1. Jaames

    Jaames Active Member Licensed User

    Hi, there is attachment with example on how to get the method (b4a function - sub) name using Inline Java.
    This can be useful in many cases, especially for error reporting - debugging, but there are ton of other use case scenarios :)
    See it for your self
     

    Attached Files:

  2. b4auser1

    b4auser1 Well-Known Member Licensed User

    Thank you for the code snippet. It will help me to simplify my code.
     
    Jaames likes this.
  3. b4auser1

    b4auser1 Well-Known Member Licensed User

    Code for a service is like as for Activity ?
     
  4. Jaames

    Jaames Active Member Licensed User

    Sure, I modified example in first post, there is service example also.
     
  5. b4auser1

    b4auser1 Well-Known Member Licensed User

    Thank's
     
    Jaames likes this.
  6. baron

    baron Member Licensed User

    Hi Erel,

    I'm trying to interface with a 3rd party Android credit card app from B4A. It will start the app, but locks up. I suspect the 1st parameter to initiatePayment is wrong. It locks up when I call it with the B4A Activity.

    Note that TransactionRequest is a structure which is created by another method in the same jar. It seems to work OK, so I'm assuming the problem is the 1st parameter.

    public void Stage3(Activity BA) {

    // create a currency object with specified locale

    try {

    String orderId = "456789";

    PaylevenApi.initiatePayment(BA, orderId, request);

    }
    catch (NumberFormatException e) {
    Toast.makeText(getApplicationContext(), "invalid_amount", Toast.LENGTH_LONG).show();
    }
    }


    Supplied documentation is as follows:

    "Issues a TransactionRequest to the app. You need to override onActivityResult of your Activity to receive the response"
    Parameters:
    activity - the activity that will receive the result
    orderId - a unique id that identifies the payment.
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for your question and make sure not to limit your question to a single member.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice