kivy import android doesnt work - android

I'm building a small project for my android phone using kivy. I am trying to get the android back key to do a make Toast saying 'press back again to exit', and then exit when the back key is pressed twice. I checked online and saw a tutorial on how to do this. I had to useimport android
but the problem is that it just doesn't work on my phone. Not on kivy launcher when i tested it. I even compiled to an android apk using buildozer, but it still doesn't work. Please im still very new to kivy and android api. Help me get this right. Or if there is another way to do this i also appreciate it. Please include an example in your response.

Hello guys I finally found the problem. The import android actually works.
The problem was that I used it wrongly . I was trying to do a makeToast like dis 'android.makeToast'. Evidently dat was wrong. Found out there was another way to do it with pyjnius.
Thanks so ooo much for your assistance

Related

Matplotlib with Pydroid 3 on Android: how to see graph?

I'm currently using an Android device (of Samsung), Pydroid 3.
I tried to see any graphs, but it doesn't works.
When I run the code, it just shows me a black-blank screen temporarily and then goes back to the source code editing window.
(means that i can't see even terminal screen, which always showed me [Program Finished])
Well, even the basic sample code which Pydroid gives me doesn't show me the graph :(
I've seen many tutorials which successfully showed graphs, but well, mine can't do that things.
Unfortunately, cannot grab any errors.
Using same code which worked at Windows, so don't think the code has problem.
Of course, matplotlib is installed, numpy is also installed.
If there's any possible problems, please let me know.
import matplotlib.pyplot as plt
#draw something
plt.savefig("picturename.png")
Then you can find the picture file in your disk and open them manual.
I also had this problem a while back, and managed to fix it by using plt.show()
at the end of your code. With matplotlib.pyplot as plt.
I'm having similar problem with matplotlib in Pydroid3. My cellphone is a Motorola. In my case, the code executes completely without errors, but the plot window even opens.
Follow my code (of course seaborn (as sns) was installed and imported, as much matplotlib.pyplot as plt):
sns.regplot(x=score,y=target,data=df)
plt.show()
After reinstalling it worked.
The problem was that I forced Pydroid to update matplotlib via Terminal, not the official PIP tab.
The version of matplotlib was too high for pydroid
Yep, for Android I used as below and it worked :
#plt.show() // just comment out as it may not display from Pydroid Terminal anyway
plt.savefig('yourplot.jpg') // save plot as Jpeg file for Android
plt.close() // close matlab plotting
I got same problem.
Add "%matplotlib inline" while importing mathplotlib and/or seaborn.
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
You just need to add a line
plt.show()
Then it will work. You can also save the file before showing
plt.savefig("*imageName*.png")
like was said in other answers plt.show and plt.savefig will do the job; but when I wanted to see help(documentation) of matplotlib.pyplot, that wasn't working. so I saved my program and then run it in terminal:
import matplotlib.pyplot as plt
help (plt)
for example we can save it in newfile.py
and doing this in terminal:
python newfile.py

Getting an App APK

Hey guys and girls for a the past week I've grown a lot of interest in android studio (even without knowing quite much about it) I decided to create an app that I deemed quite useful. However the app required maps to be integrated in it and I really did not know what I was doing and at one point I started messing with the settings and then all hell broke loose and I kept getting AAPT2 errors and I even tried to fix this issue with the gradle properties line that you add (I forgot the line of code to add). Anyways it still didnt work. However I rembered that I always kept the good version (before I broke everything) of the app on my phone. So when I go in my phone the app is there and it works just fine. Ive tried so many things to get the source code from the app on my phone without any succes. My question is, how can I get the source code back from the working app onto my laptop to continue coding in android studio? If it helps I am using Linux 18.04 LTS and running the newest version of android studio. Thank you for any help from you guys. This means a lot to me.
You can’t get back the ‘source code’ from an already compiled app.
You should consider using some version control platforms like git from the next time

Android Studio is not accepting new project

I want to start learning Android programming and recently downloaded the Android Studio. Now if I want to start a new project, I can't get past this initial screen. Whenever I click next, the window just jerks, which I guess is indicating that I am doing something wrong. So how can I solve this problem?
Note: I am a total beginner but I am genuinely trying to learn and searching the web for the problem didn't give me any solution.
I guess something is wrong with your Android Studio / JDK installation. In the status bar on the bottom, I can see a NullPointerException. I think this is the cause. Try to open the Android Studio Log and hopefully the error is better explained there.
How to find Android Studio Log
Maybe you have unknown characters in your package name like "ı,ö,ü" ? And you may want to watch a android starter tutorial video which has a part about starting a project to see if you are doing something wrong?
If it couldn't be a good answer sorry for it but that's all i can offer :3

Git terminal goes crazy whenever I revise code or layout on android studio

As the title states I am making an app with android studio. I recently installed git as well in order to interface with GitHub. For some reason whenever I change the layout on the layout editor, or type more than 3 characters of code the git terminal opens up multiple windows, then they disappear, and I get no errors of any kind. It repeats indefinitely and I am really unable to get any work done because of it. Has anyone seen anything like this before and if so I would love any help I could get. Thank you! I tried to make this as detailed as possible hopefully it isn't too broad.

Genymotion, Unfortunately your APP has stopped

My problem is very commun here, there are many topics talks about it, i tried everything but it's not working, but i'm sure that it's not hard enough, maybe because my stupidity lol ...
My story start when i converted a APK File to Source Code, then i imported the source code to ECLIPSE, i did some changes like changing the app name..
But when i want to see the changes i did in Genymotion, it shows :
Unfortunatly my app has stopped...
here are the screenshots :
http://imgur.com/v7Zcx89
http://imgur.com/pD8JSPS
Thanks in Advance Guys :)

Categories

Resources