My last question about the same topic was not clear enough and was put on hold by community and later it was automatically deleted. So, I am explaining that Question in deta
I have made successfully this type of application like voodoo.and get Flipkart product page title, price etc successfully. the following method used to get user open product screen.
private boolean isOpenFlipkartProductScreen(AccessibilityNodeInfo nodeInfo){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
if(nodeInfo.getViewIdResourceName()!=null){
if(nodeInfo.getViewIdResourceName().equals("com.flipkart.android:id/callout_last_linearlayout")){
Utils.sPrint("You just open product page : " + nodeInfo.getClass());
isOpenProductPage = true;
return true;
}
}
}
return false;
}
and following code to used get product title name and price.
private String getObtainTitle(AccessibilityNodeInfo sourceInfo){
if(sourceInfo == null)
return "";
AccessibilityNodeInfo nodeInfo = sourceInfo.getParent().getParent();
if(nodeInfo!=null){
int i = 0;
int i2 = 0;
for(int i3=0;i3= Build.VERSION_CODES.JELLY_BEAN_MR2) {
if(nodeInfo.getChild(i3).getViewIdResourceName().equals("com.flipkart.android:id/title_layout")) {
i = 0;
// while ( i < nodeInfo.getChild(i).getChildCount()){
AccessibilityNodeInfo child = nodeInfo.getChild(i3).getChild(i);
String charSequence = child.getText().toString();
// Utils.sPrint("Title is : " + charSequence);
if(charSequence!=null){
return charSequence;
}
// }
}
}
/*
*
* Below code to used for getProduct prise in flipkart app product
*
* */
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
if(nodeInfo.getChild(i3).getViewIdResourceName().equals("com.flipkart.android:id/price_layout")){
AccessibilityNodeInfo child = nodeInfo.getChild(i3).getChild(i);
String charSequence = child.getText().toString();
if (child.getText().toString().toUpperCase().startsWith("RS.") ||
child.getText().toString().toUpperCase().startsWith("\u20b9")) {
String replace = charSequence.replace("Rs.",
"").replace("\u20b9", "");
//return replace
// Utils.sPrint("Prise is : " + replace);
}
}
}
}catch (Exception ex){
// Utils.sPrint("Ex : " + ex.getMessage());
return "";
}
}
}
return "";
}