Answer the question
In order to leave comments, you need to log in
How and how to debug apk for Android in Cordova?
Greetings. The situation is this:
- The application (on Vue) builds normally (without error messages) in Cordova, but when you try to run it in the Android Studio emulator, it just shows a white window and that's it.
- At the same time, the same application is normally assembled in Cordova and works for the browser platform.
- Other Android apps build and run fine in the same emulator too.
- That is, both the code is working and the build environment is also working, but something is not glued between them.
How can this be debugged at all? What are the tools for this? I'm just new to Android.
What exactly do I need to do to find the problem? Thank you.
Answer the question
In order to leave comments, you need to log in
https://www.youtube.com/watch?v=s4zpL4VBbuU Search this for "chrome usb remote debugging"
Change the condition to
if not b and ( c=='mod' or c=='/' or c=='div'):
print("Делеение на ноль")
if not b and c in ['/','%', 'mod', 'div']:
print("Делеение на ноль")
a = float(input())
b = float(input())
c = input()
z_div = 'Деление на ноль!"
OPERATORS = {
"+": a + b,
"-": a - b,
"*": a * b,
"/": a / b if b else z_div,
"mod": a % b if b else z_div,
"div": a // b if b else z_div,
"pow": a ** b
}
print(OPERATORS[c])
a = float(input())
b = float(input())
c = input()
z_div = 'Деление на ноль!'
OPERATORS = {
"+": lambda x, y: x + y,
"-": lambda x, y: x - y,
"*": lambda x, y: x * y,
"/": lambda x, y: x / y if y else None,
"mod": lambda x, y: x % y if y else None,
"div": lambda x, y: x // y if y else None,
"pow": lambda x, y: x ** y
}
print(OPERATORS[c](a, b))
a = input()
b = input()
c = input()
OPERATORS = {
"+": "+",
"-": "-",
"*": "*",
"/": "/",
"mod": "%",
"div": "//",
"pow": "**"
}
if not float(b) and c in ['/','%', 'mod', 'div']:
print('Деление на ноль!')
else:
print(
eval(
a + OPERATORS[c] + b
)
)
Specifically, in your code, the condition for checking division by 0 is incorrect:
if (b==0.0) and ((c=='mod') or (c=='/') or (c=='div')):
check is whether the second operand is zero, and whether the function is ONE OF THE division functions (and not all at once).
Z.Y. hello to everyone who came here from the stepik)))
I'll leave the info here for the same sufferers like me:
1) In this task, you do not need to define all these mod, div, pow as variables in which the calculation is already performed through other variables.
Like this, DO NOT:
mod = (a) % (b)
pow = (a) ** (b)
div = (a) // (b)
elif (b == 0) and f == 'div':
print('Деление на 0!')
elif f == 'div':
print(a // b)
a = float(input())
b = float(input())
c = input()
z_div = 'Деление на ноль!'
OPERATORS = {
"+": a + b,
"-": a - b,
"*": a * b,
"/": a / b if b else z_div,
"mod": a % b if b else z_div,
"div": a // b if b else z_div,
"pow": a ** b
}
print(OPERATORS[c])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question