What is drawback if i use Tap() method to identify elements instead of findElement(By.id("")?

I have written automation script using java for android and it is working fine but while using the same script for IOS , it gives the error . same script working fine while i have use Tap() method to identify elements instead of findElement(By.id("")… Is it the best way for automation testing. Give me favour.

tap() is an event on any element whereas findElement(By.id("") is locator strategy. You are combining two very different things.

Thanks for the response. My question is why the same android test case does not work for IOS app testing for the same app. I have provided a proper id for ios till it is not working.

Following Test case working for android

public void Setting() throws InterruptedException
{
try{
driver.findElement(By.id(“com.hannainst.hannalab:id/btnSettings”)).click();
Boolean iselementpresent = driver.findElementsByName(“Last Calibration:”).size() != 0;
Assert.assertTrue(iselementpresent,“Last Calibration:”);
System.out.println(“TC6 :-Setting screen proper”);
} catch(Throwable e)
{
System.out.println(“TC 6:-Test Case Failed”);

  }

}

Following Test case working for IOS

public void Test_Setting()
{
try{
driver.tap(1,9,6,1);
Boolean iselementpresent = driver.findElementsByName(“Change View”).size() != 0;
Assert.assertTrue(iselementpresent);
System.out.println(“TC1:-Menu Drawer successfully opened”);
driver.tap(1,134,526,1);
} catch(Throwable e)
{
System.out.println(“TC1:-Menu Drawer doesnot successfully opened”);

  		}
	}