Seeking High Level Guidance

88 views
Skip to first unread message

Nick Campion

unread,
Jan 29, 2011, 12:03:25 AM1/29/11
to Robolectric
I'd like to start testing some of our apps using Robolectric. We make
use of some of the meta-data tags in our AndroidManifest.xml
programatically using ApplicationInfo and PackageManager. I looked at
the code a little bit and made a small change to TestSharedPreferences
(to add support for getAll) and was able to get that compiled in and
working. I'm trying to figure out the best way to approach adding
support for PackageManager.getApplicationInfo. We then access the
metaData Bundle inside the appInfo. I'm not sure how you guys
normally approach these things so I was wondering if anyone could
share some hints or ideas about how to get started. Perhaps its
already implemented and I'm just not approaching it correctly, I'm not
entirely sure :)

Nick

Christian Williams

unread,
Jan 30, 2011, 8:49:12 PM1/30/11
to robol...@googlegroups.com
Hey Nick, sorry for the delay getting back to you.

PackageManager is a little atypical in that it's mostly abstract, so rather than shadowing it, we've implemented it as RobolectricPackageManager. You should be able to implement most of what you want there. RobolectricConfig.parseAndroidManifest is where the AndroidManifest.xml is parsed.

We'd love to get a pull request when you get this tested and working!

Thanks!

--X [typos courtesy of my iPhone]

Phil Goodwin

unread,
Jan 31, 2011, 2:04:30 PM1/31/11
to robol...@googlegroups.com
We've added a story to implement PackageManager.getApplicationInfo(). It hasn't been scheduled yet, so I don't know when it will happen, but it will happen.

Phil

Christian Williams

unread,
Jan 31, 2011, 6:26:01 PM1/31/11
to robol...@googlegroups.com
Nick, your best bet is to add what you need and send a pull request.


--X [typos courtesy of my iPhone]
Reply all
Reply to author
Forward
0 new messages