What do I need to know and do before developing an app?

I have this great idea for an app that I want to develop. I know some Java and some other languages but not an expert in any. I want to build from scratch as I don’t want to have my idea stolen or anything of that sort. I know it’s a long shot but I figure the experience will help me in the long run.

Would it be best for me to create a website first and then the app? Do I need to create the database or is there a way to rent or buy one ? How does it work regarding a server that I would need to connect to again how do I go about this entire process.