What Scott said. You would have to create and use a custom SDK.

On Wed, Dec 17, 2014 at 8:09 AM, 'Scott Barta' via adt-dev <
adt-dev@googlegroups.com> wrote:
>
> You can't do this in Android+Gradle right now. Gradle doesn't favor the
> notion of import order, but uses a system where you declare your
> dependencies explicitly. What you would need to do is to tell Gradle that
> your project depends on your custom android.jar instead of the SDK one, but
> there's no way to do that, since the reference to the SDK's version is
> hardcoded in the SDK and isn't accessible.
>
> On Tue, Dec 16, 2014 at 8:03 AM, Vincent de Chefdebien <v.dec...@gmail.com
> > wrote:
>>
>> I'm trying to migrate my project from Ant to Gradle, and i cannot solve
>> the following issue: I need to access android @hide fields (without
>> reflection).
>>
>> Up until now, I used a custom jar containing java classes with all the
>> hidden fields (example: WifiManager.WIFI_SCAN_AVAILABLE). Note that this
>> custom jar was used only as a reference (excluded from final apk). In
>> Eclipse, I modified the classpath (in "order and export" tab) to have this
>> custom jar above the android SDK's jar.
>>
>>  In Ant, i had to add the following lines, in my project's
>> custom_rules.xml:
>>
>> <path id="project.target.class.path" >
>>     <pathelement location="../../misc/classes-full-debug_V5.0.jar" />
>>     <pathelement location="${project.target.android.jar}" />
>> </path>
>>
>> With this i was able to use hidden fields from WifiManager,
>> TelephonyManager, ConnectivityManager, etc.
>>
>>
>> How do I reproduce this behaviour using Gradle ? The problem is that the
>> Gradle is accessing the 'unmodified' WifiManager class (provided by the
>> android sdk) instead of the custom one. Is there a way to shadow it?
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "adt-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to adt-dev+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "adt-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to adt-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adt-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to