How to convert website into android app


#1

How to convert website into android app


#2

there are two way :

1 - using web view (sample - show website as a browser)
2 - using api (more advance - communicating with site by api)


#3

Thanks for you response @ebeliejinfren
Can you give me an example of code.


#4

I’m interested on how to do the first option too.


#5

in api there are a lot code and option
whats your site script ? is it wordpress ?

but for you that want start best way using youtube tutorial
first step is fetch post data


#6

Actually i want web view also i try to do using inAppBrowser but there is a one problem.
when user press back button the web page navigate to ionic app but
I want the user to be stuck in the view loaded via InAppBrowser and when he uses “back” button to simply close the app, not navigate in the original ionic app that encapsulates the view.


#7

i don’t understand
you want to when click back button close the app ?
in this case you can set a custom function to back button


#8

When the website returns to the homepage then when user click on back button app should be closed


#9

here is my code

ngOnInit(){

  let url = 'https://example.com/';
      let browser = this.iab.create(url, '_blank', 'location=yes');
      
    }

#10

for close app when back button click there are tutorial and sample code in forum and web
you can add a if to when url address of browser = homepage url then close app


#11

please give me a example code please .


#12

I have solved my issue
below my solution

ngOnInit(){
      this.platform.ready().then(() => {
            const browser = this.iab.create('URL','_self',{location:'no', zoom:'no'});
            browser.on('exit').subscribe(() => {
           this.platform.exitApp();         
      });
    });
}