Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QtAndroid, exchanging data between c++ and android

QtAndroid, exchanging data between c++ and android

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 2 Posters 285 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mrdebugM Offline
    mrdebugM Offline
    mrdebug
    wrote on last edited by mrdebug
    #1

    These are 3 example functions

        public void Test01() {
            System.out.println("Test01");
            System.out.println("Test01");
        }
    
        public void Test02(int a) {
            System.out.println("Test02");
            System.out.println("Test02");
        }
    
        public int Test03() {
            System.out.println("Test03");
            System.out.println("Test03");
            return 321;
        }
    

    And that is how I call them

        QtAndroid::androidActivity().callMethod<void>("Test01", "()V");
        QtAndroid::androidActivity().callMethod<void>("Test02", "(I)", 123);
        QtAndroid::androidActivity().callMethod<jint>("Test03", "()V");
    

    Only the first "Test01" works, the second and the third generate the exception

    W System.err: java.lang.NoSuchMethodError: no non-static Test02(I)"
    W System.err: java.lang.NoSuchMethodError: no non-static Test03()V"
    

    Which kind of mistake am I making?

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

    1 Reply Last reply
    0
    • mrdebugM Offline
      mrdebugM Offline
      mrdebug
      wrote on last edited by
      #2
      QtAndroid::androidActivity().callMethod<void>("Test02", "(I)V", 123);
      QtAndroid::androidActivity().callMethod<jint>("Test03", "()I");
      

      Need programmers to hire?
      www.labcsp.com
      www.denisgottardello.it
      GMT+1
      Skype: mrdebug

      M 1 Reply Last reply
      0
      • mrdebugM mrdebug
        QtAndroid::androidActivity().callMethod<void>("Test02", "(I)V", 123);
        QtAndroid::androidActivity().callMethod<jint>("Test03", "()I");
        
        M Offline
        M Offline
        mvuori
        wrote on last edited by
        #3

        The method signatures are wrong.
        2 should be "(I)V", 3 should be "()I"

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved