How do I exit Qpython (android) console automatically afer script completes? - android

I'm running Qpython (andoid) 1.2.3 (the latest as of 2016-01-31) and I can get scripts to run. I've been able to create a shortcut on my homescreen for a simple test script that put the current date in yyyy-mm-dd format into the clipboard, and speaks the content. I have #qpy: console directing the script to execure in the console. When I click the shortcut, the clipboard is happily updated, and read out to me. But... the console window stays open, telling me to hit enter to close the window.
I have tried:
adding "exit"
adding "exit(0)"
adding
import sys
sys.exit()
I have tried printing ctrl-d
I still get the console staying open until I manually hit enter.
I tried reheadering my script to run as kivy instead of console, and I could get it to exit, but it takes several seconds to load up kivy, and it's silly to load a huge amount of gui capability, when I neither need nor want them.
How can I close the console automatically?

Can you upgrade to the newest version ?
And it support Q mode, just insert "#qpy:qpyapp" into your script.
http://www.qpython.org/en/guide_program.html (In the end of the page)

edit the file end.sh. Remove or comment the "read" command.

Related

Firebase init is not create a default project its stop by saying a title project setup

I am new to firebase.
I am trying to use firebase cloud function for my project.
I have installed npm and nodejs on my windows machine and then I login my firebase account using:
firebase login
Then I created a folder where I want my scripts to be. i've gone to that path in cmd and try to run:
firebase init
It as an alert are you ready to proceed I given y.
Then it blinking till here which I have attached in my image
Can anyone help me out what to do?
All you have to do it select one of the options:
- Database
- Functions
- Hosting
I'm using a linux (see below) so all I have to do is press enter. I don't know about Windows, but I think its expecting you to enter some response.

How to keep data when run command calabash-android run

My Android application have to synchronize data in the first time. It spend about 15 minute for synchronization. And in secondtime, I don't need get data from server. But when a run calabash to test feature:
calabash-android run MyApp.apk
I feel it remove all data in my app and rebuild application.
So, how to keep data when I run feature Scenario for my app?
My scenario :
Feature: create work order
As a techinical
I want to create work orders
So I can manage WO easier
Scenario: Technician create work order successfully
Given I am on the Create Work Order Screen
And I select customer name which is "Harris Teeter"
And I select equipment serial number which is "1A100438"
And I select Job code "1" and then is "100 HOUR SERVICE"
And I select order type "401"
And I input valid title "Create new work order"
And I input valid description "Work order description"
Then I see the successful messages "The new work order has been created successfully"
Try command
NO_LAUNCH=1 cucumber --format html --out index.html features/Your_feature_file.feature
It won't relaunch your app. But you need to run the app first time before you run this command. As long as your app in the foreground this command works.
Note: I use this for iPhone testing it should work on android too.
This is because calabash-android reinstall app before run every scenario.
To avoid that, you can comment this code in app_installation_hooks.rb file in android support folder
uninstall_apps
install_app(ENV["TEST_APP_PATH"])
install_app(ENV["APP_PATH"])

Facebook SDK 3.1.2 for Unity - Trouble logging in on Android Devices

I'm using the latest version of the Facebook SDK, version 3.1.2, for Unity. My problem is somewhat similar to this question. The differences being that my iOS builds work just fine. And my Android builds aren't getting null references. Instead, My android build will just not log in.
When I click my login button, it'll bring up the dialogue screen to give the app permission to access the basic stuff, public profile and friend list. Upon hitting the ok button, it'll return me to my app but fail the login. I found the AndroidFacebook class and noticed that OnLoginComplete function has a string message param where it should grab the user's id and access token from. So I put a debug message in there to see what was being returned. It turns out that although I press ok to give the app access to facebook, it's saying that the process was cancelled. {"cancelled":true} is the Json string being returned. I've doubled check my app settings in the facebook developer page and the Package name, class name and debug hash key all match what I have in the Unity Facebook settings. I've even tried with the Sandbox mode on and off.
It sounds like you don't have the android key hash set up correctly. In the Unity Editor, click the Facebook entry on the main menu bar, then click "Edit Settings". Find the item marked "Debug Android Key Hash" and copy the value to your clipboard.
Navigate to http://apps.facebook.com and find you app. Paste the key hash you took from the editor into the "Key Hashes" section of your apps native android setup. This page has a picture of how your setup should end up looking.
Does your main activity extend the FBUnityPlayerActivity class?
We're running into the same problem, and tried the same fixes - just now noticing this as a warning in the editor logs.

Out-of-the-box app-engine connected android project not working -- app crashes

I have been following to the letter the simple tutorial on Creating an App Engine Connected Android Project using the eclipse plugin.
After setting up everything, running the project leads to two possibilities:
If LOCAL_ANDROID_RUN = false, the project spits out the expected complaints:
1) Registration with Google Cloud Messaging...SUCCEEDED!
2) Registration with Endpoints Server...FAILED
Either your Cloud Endpoints server is not deployed to App Engine, or your
settings need to be changed to run against a local instance by setting
LOCAL_ANDROID_RUN to 'true' in CloudEndpointUtils.java.
If LOCAL_ANDROID_RUN = true, the second I click "register" the app crashes! This is the part I don't get. I am running the project right out of the box. The only thing I did was change LOCAL_ANDROID_RUN from false to true.
So I have been researching for the past four hours on a resolution. I see talks about -a 0.0.0.0 or -bindAddress 0.0.0.0; unless I am setting them incorrectly (I probably am), they are not working. Sometimes I get the "error" below. So if that's my problem please, what exactly am I supposed to have in the argument box before I click apply and run?
Options:
--help, -h Show this help message and exit.
--server=SERVER The server to use to determine the latest
-s SERVER SDK version.
--address=ADDRESS The address of the interface on the local machine
-a ADDRESS to bind to (or 0.0.0.0 for all interfaces).
--port=PORT The port number to bind to on the local machine.
-p PORT
--sdk_root=DIR Overrides where the SDK is located.
--disable_update_check Disable the check for newer SDK versions.
--generated_dir=DIR Set the directory where generated files are created.
--jvm_flag=FLAG Pass FLAG as a JVM argument. May be repeated to
supply multiple flags.
Any insights on how to get this out of the box project to work?

How to use Eclipse interactive console in debug

I'm trying to play with debug in Android app and, when a breakpoint is encountered, Eclipse shows me a lot of windows, one of which is the "Interactive Console" with a prompt: I think to be able to enter statements and/or other stuff, but it seems to be disabled.
How can I work with it?
Window - Show View - Debug - Display
That will provide you with a window to enter statements and execute/inspect them.
This is a feature that's available in core eclipse platform. It works in most cases for Android based projects as well.
More info on the display view can be found here : http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/views/debug/ref-debug_view.htm
For a nice overview of the debugging features of Eclipse, check out this post : http://www.cavdar.net/2008/09/13/5-tips-for-debugging-java-code-in-eclipse/
The "Interactive Console" within the Debug View of Eclipse is used whenever the debugged program expects some input from the console.
It's possible you have other plugins installed that provide that view, and it's not meant to be used by Android Java code. See here (not accepted answer, but community-favored one).
You can use Logcat for and can see your check points using
android.util.Log.e("","CheckPoint");
You can toast your check points using Toast like:
Toast.makeText(this, "Write here what you want see",1 or 0).show();
1-> long time displaying and 0 for short time.
This toast display in your device screen when programe running.
You can use console screen for seeing output like print statements Ex---
java.lang.System.out.print("Checking");
use
try{
statements...;
}
catch(Exception e){
System.out.println("the error message "+e);
}
will show the error messages.

Categories

Resources