Use of non-public API sun.misc.BASE64Encoder;

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Use of non-public API sun.misc.BASE64Encoder;

Postby mmilen » 07 Oct 2011, 20:43

sun.misc.BASE64Encoder is non public API and any Android documentation strongly advises against it use. I'm building and Android App and a need the SFSClient as a static object in the Application object. However init of SFSClient fails with class not found sun.misc.BASE64Encoder; . I the same code is executed in the main Activity everything works like a charm. Any Help?
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Postby mmilen » 07 Oct 2011, 22:25

Further to my post here is the statement from Oracle : http://www.oracle.com/technetwork/java/ ... 42232.html
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 08 Oct 2011, 06:49

I am no Android expert but what difference is there between having SFSClient as static or not?
Does the declaration as static generate the problem, if so why?

As regards the Base64 class you are right, we'll see if we can use something else that is more Dalvik-friendly :)

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Postby mmilen » 14 Oct 2011, 12:02

The issue is that the SFSClient object has to be outside the activity object, as activities are destroyed and recreated if you rotate the device. So far the only place I was able successfully to init SFSClient object is in an activity. Everywhere else I get sun.misc.BASE64Encoder class not found error.

Return to “SFS2X Java / Android API”

Who is online

Users browsing this forum: No registered users and 48 guests