How to use Android restricted API methods ¿reflection? -



How to use Android restricted API methods ¿reflection? -

i'm developing app has scheme privileges , want utilize intallpackage() , deletepackage() methods, aren't visible in regular api. have no thought how utilize reflection create these methods available. knows how can access methods code? steps create them available on android sdk? tutorials it?

as suggested, can done reflection. avoid changes in sdk causing problems it's thought validate methods first before calling them, ensure exists , have right method signature.

if grab android source code should able find of hidden methods, marked @hide annotation.

edit:

here (incomplete) example, enabling access point programatically should give clues:

wifimanager wifimanager = (wifimanager) getsystemservice(context.wifi_service); method method = wifimanager.getclass().getmethod("setwifiapenabled", wificonfiguration.class, boolean.class); method.invoke(wifimanager, config, true);

essentially, method , invoke it.

android reflection android-package-managers

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -