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 6581449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:09:16+00:00 2026-05-25T16:09:16+00:00

My application has many activities and uses native library too. With the default ProGuard

  • 0

My application has many activities and uses native library too. With the default ProGuard configuration which Eclipse generates ProGuard removes many things – OnClick methods, static members, callback methods which my native library uses… Is it there a simple way to instruct ProGuard to NOT remove anything from my package? Removing things saves only about 2.5% of the application size, but breaks my application completely. Configuring, testing and maintaining it class by class in ProGuard configuration would be a pain.

  • 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-25T16:09:16+00:00Added an answer on May 25, 2026 at 4:09 pm

    As final result I found that just keeping all class members is not enough for the correct work of my application, nor necessary. I addded to the settings file this:

    -keepclasseswithmembers class * {
        void onClick*(...);
    }
    -keepclasseswithmembers class * {
        *** *Callback(...);
    }
    

    The case with onClick* is for all methods which I address in android:onClick atribute in .xml layout files (I begin the names of all such methods with ‘onClick’).

    The case with *Callback is for all callback methods which I call from my native code (through JNI). I place a suffix ‘Callback’ to the name of every such method.

    Also I added few rows for some special cases with variables which I use from native code, like:

    -keep class com.myapp.mypackage.SomeMyClass {
        *** position;
    }
    

    (for a varible with name ‘position’ in a class with name ‘SomeMyClass’ from package com.myapp.mypackage)

    All this is because these onClick, callback etc. must not only be present but also kept with their original names. The other things ProGuard can optimize freely.

    The case with the native methods is important also, but for it there was a declaration in the generated from Eclipse file:

    -keepclasseswithmembernames class * {
        native <methods>;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application which has many services and one UI module. All these
In my application I have many classes and activities. Droid is a class which
My application has a master and many slaves which respond to the master's call-over
If my application has too many static variables or methods, then as per definition
I have an application which has many stories Each story has and belongs to
I tempted to apply skin to my winform application which has many datagrids. Many
I have an application that depends on connection It has many Activities.I need to
I have an iPad application which has many categorized images I need to switch
I'm writing a MATLAB application which has many functions spread over different files. I
I have an application which has many icons (Buttons). I want to put a

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.