Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 7    Views: 90

mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
04/19/15 02:48 PM (9 years ago)

Updating an old 2.0 plugin to 3.0 (android)

Hi folks! I need to update a 2.0 plugin to work for 3.0, android. I know 3.0 used fragments - but that's pretty much as far as my knowledge goes. Would anyone throw me a link to a guide or tell me the steps I would need to take to convert an old BT 2.0 android plugin to 3.0 android fragment plugin? Many thanks :-) David
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
04/19/15 03:27 PM (9 years ago)
Quick guide while I'm away from the computer: Copy the variables above onCreateView as usual. Then whatever is under onCreate v2,copy in onCreateView in v3. Then all the methods (and maybe classes) under the onCreate closing brace, copy under the closing brace of onCreateView in v3. Also you might get errors on "this" variables. In v2 it was referring to this activity, so in v3 change it to getActivity() I'll post an example when I get home
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
04/19/15 04:59 PM (9 years ago)
Yep - CMCoffee has covered the basics. There's some other nuances that can hang you up depending on what's in the code of course. Let me know if you need me to take a look.
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
04/19/15 05:00 PM (9 years ago)
Hey Chris, Updating one of the plugins you made me actually, Smug and Coffee have been a huge help, still a few errors left, let me have a go on it and if I can't figure this out in another hour I'll shoot you an email. Thanks. David
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
04/19/15 05:01 PM (9 years ago)
haha - what do you know! Let me know how I can help :)
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
04/20/15 04:25 AM (9 years ago)
If I remember correctly, it's basically the same but just copy and paste onCreate view or above it? LA
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
04/20/15 05:58 AM (9 years ago)
>basically the same but just copy and paste onCreate view or above it That's a start but by no means the whole story. CMCOFFE explained in the post above the general procedure for BT. Google this: "android convert activity to fragment" and you will find a long list of problems and some of them you are guaranteed to be forced to solve, depending on what the plugin does.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
04/20/15 06:25 AM (9 years ago)
David sent the plugin to me and I updated already.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.