Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7419809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:08:05+00:00 2026-05-29T08:08:05+00:00

I have a method inside my gnutls .c file as follows int gnutls_error_is_fatal (int

  • 0

I have a method inside my gnutls .c file as follows

 int gnutls_error_is_fatal (int error)
        {
   int ret = 1;
   const gnutls_error_entry *p;

  /* Input sanitzation.  Positive values are not errors at all, and
   definitely not fatal. */
  if (error > 0)
  return 0;

   for (p = error_algorithms; p->desc != NULL; p++)
    {
    if (p->number == error)
      {
        ret = p->fatal;
       break;
       }
      }

        return ret;
        }

how do i define it inside my activity class so that i am able to use it and get a return value?

i’ve tried

     private native int gnutls_error_is_fatal(int i);


     @Override
      public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);

      // this is where we call the native code
      int hello = gnutls_error_is_fatal(1);

but it isn’t able to work

gives the following error

    E/AndroidRuntime(  756): FATAL EXCEPTION: main
E/AndroidRuntime(  756): java.lang.ExceptionInInitializerError
E/AndroidRuntime(  756):    at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime(  756):    at java.lang.Class.newInstance(Class.java:1409)
E/AndroidRuntime(  756):    at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime(  756):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
E/AndroidRuntime(  756):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
E/AndroidRuntime(  756):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime(  756):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
E/AndroidRuntime(  756):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  756):    at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  756):    at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime(  756):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  756):    at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(  756):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime(  756):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime(  756):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(  756): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load REALGnuTLS: findLibrary returned null
E/AndroidRuntime(  756):    at java.lang.Runtime.loadLibrary(Runtime.java:429)
E/AndroidRuntime(  756):    at java.lang.System.loadLibrary(System.java:554)
E/AndroidRuntime(  756):    at com.test.example.REALGnuTLSActivity.<clinit>(REALGnuTLSActivity.java:12)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T08:08:05+00:00Added an answer on May 29, 2026 at 8:08 am

    Have you build the native library properly and generated the jni header?

    Check out this tutorial:

    http://marakana.com/forums/android/examples/49.html

    It’s little dated but the general approach should still be the same.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method inside a webservice, with the following signature: @WebResult(name=purchaseId) public int
I have a method that I'm writing that is calling another overloaded method inside
I have a method that varies by a single method call inside, and I'd
Setup: I have a COM DLL that calls a method inside a managed C#
Example: I have a method -myFooBarMethod:withFoo:bar:moreFoo: and inside the implementation of that method I
I have a question What happend when I declare a variable inside a method,
I have a view inside a tabbarcontroller and navigationcontroller and my 'willAnimateRotationToInterfaceOrientation' method is
I have Activity with ListView inside it and in the onCreate method of the
So, I have a method create inside my controller, but once I create my
I have a ticket model which has a method inside called closes_in that calculates

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.