I strongly suggest that you write your own code. Do the FCC challenges, read books, buy a course, but do it yourself. Besides, if you copy someone else’s code, that could be outdated, how do you know it’s safe?
You MUST visibly attribute ANY SO code, AND use the SAME LICENSE for the WHOLE APP. If someone copies changes and uses your code, you cannot stop them while you have the SO-licensed code in your app.