Custom app plugin Development

I need some guidelines for developing custom app plugin development. and In the app plugin need to implement custom pages and form and in the form i need to post some values and retrieve.

I Have the scenario like this one

  1. I have some gateways which will get data. for this one we need to add device by using app plugin
  2. added devices need to display in the plugin

Here are added custom app plugin and I am not able to save above values in to database
Can anyone help me out on this one