How to use "gsUtil" to get financial reports of apps? - java

Background
When you publish an app, you can access the financial report via this website that can lead you to this website which leads to :
https://play.google.com/apps/publish/?dev_acc=SOME_NUMBERS#ReportsPlace
where "SOME_NUMBERS" is probably a unique ID for your account or something.
at the bottom, it says :
Financial reports are also available for programmatic access through
Google Cloud Storage and the gsutil tool. Your reports are stored in
this private bucket:
gs://pubsite_prod_rev_SOME_NUMBERS
(same note about SOME_NUMBERS as before)
The problem
After installing both Python requirements (from here) and the gsutil (from here) , I can't find out how to really use what they've written.
Not only that, but for any command I try to run there, I get:
SyntaxError: encoding problem: utf8
I've found some posts here on stackOverflow talking about this error, but since I don't know python, I find it hard to understand how to fix it.
The question
How do you really use the gsUtil?
Is it possible to fix this issue?
Is it possible to access the financial data in any other way? Is there maybe a Java alternative? Maybe even an SDK that has all of the available commands?

Related

Is it possible to build a web automation that can run through a browser?

I have created a Java program that utilizes Chrome Driver, Selenium, and Java Excel API. The program is used to automate a few different processes on Google Chrome. Currently, setting up this automation is more complicated than I would like it to be: the user needs to download a zipped folder, unzip it, download the Java Runtime Environment, and launch the program using the executable.
My goal is to simplify the installation of the automation. Ideally, a user would come to a SharePoint website, fill out a form with the parameters of the automation (potentially upload an Excel Workbook), click an "execute" button, and the automation would run. As a result, the automation would run seamlessly across platforms (Windows and MacOS) without any modifications.
I have researched changing the programming language to achieve this functionality. I concluded that a different language could remove the need for a Java Runtime Environment download, but it would still require some type of installation process. Additionally, I have researched using HTML/JavaScript, but I concluded that this is not possible because the functionality (triggering a web automation from a website) could be used maliciously without the user's knowledge. Finally, I began researching containerization through Docker. This solution seems promising but I do not know enough about it to determine if it is the appropriate solution.
What would be the best route to achieve the results that I am looking for (outlined in the second paragraph)? I have access to enterprise-grade databases that I thought may be useful. Would it be possible to have the form trigger a virtual machine to run the automation on a remote database and then output the result to the user once it has finished?
Thank you in advance for any guidance you can provide. I do not know much about making a Java program into an enterprise-grade application so any information about what to research is extremely useful. Finally, please do not hesitate to correct my logic at any point in this question as I may have drawn the wrong conclusions from my research.
You want to look into creating a jar file with your selenium code.

How to combine a standalone application with an Android application?

How do I combine a standalone Java application with an Android application?
I have a piece of code taken from the Google quick start examples that perform a task that I can't seem to be able to combine with my activity source code.
I'm of course talking about the following Google example: Sheet API, if I just add it as a standalone class and tell Android Studio to run this application, before my Android application, then it will produce what the code is suppose to do.
If I try to copy and paste the exact code into one of my activities it will give a couple of problems. One is that it can not find my keystore, another is a threading issue which I understand, another being that it can not find the credentials (even if the file is present), the newTrustedTransport-method call will be an issue, the setDataStoreFactory-method call will be an issue, file creation even with the correct uses-permissions and so on.
What is going on in the background that would make exactly the same source code work in one instance and not the other? What do I not know about Android Studio, and how an Android project works in the background for me having these issues?
I had an idea that I could just keep this standalone application as it is and store a file with the result that this Sheet example would provide me. But, since I do not have enough experience with Android Studio I have no idea if the result will be available for the actual Android application once it was made into a release. Will it? I can't save the output file generated by the Sheet example, under the res-folder, under the app module for some reason (scope?).
With other words... Can I have a standalone application, that is tasked to run before the Android application, to gather data and it will be doing this EACH time the Android application is run on a client? I feel like it would be stupid if the IDE would present this like this would actually work but then when the application is made into a release then the standalone application will not "follow" and be part of the release...
If I could just combine the source codes, I will not be having this issue at all. No examples online, neither Github or Youtube can provide me with answers on how to do this. Many examples online provide me with source code that is either out of date or just not what I'm looking for, and I really hate Google's way of explaining things. Just look at how they give code examples under this page: Google API Client Library for Java, and not give a full example where they would fit into the a project. Maybe all I need to make everything work is to use the code under "The library runs on Android 4.0 or higher (#Beta)."

Is the Google Drive web host link feature in danger of being phased out?

I am working on an Android app that stores log on a client's Google Drive. We push static HTML/Javascript files to said Drive in order for the user to be able to read their logs in an user friendly way via their browser. This feature worked relatively well until now (notwithstanding some glitches due to server updates in the last few months).
2 weeks ago (.e. from the beginning of October 2014) we saw that the newer user interface of Google Drive has dropped the web host link capability altogether. For legacy accounts this feature is still there, but not for newer created accounts from the aforementioned date.
Does that mean that Google is planning to ultimately drop this feature, or is it going to be available for the foreseeable future, even if only accessible programmatically via SDK?
Note that we tested to see if programmatic access is affected, and it seems to work fine. We used java SDK function getWebViewLink() (class File) in order to get the link programmatically, and it still works no 1 for now. But the change in UI from Google does worry us that this feature will be dropped, like Dropbox dropped theirs recently. Is that the case? If so, what is the expected timeline of feature deprecation and eventual disappearance?
It looks like they moved/changed it but didn't remove it altogether. The instructions from Google on how to host webpages with Drive worked for me using an account I created after the UI change (after you posted this question).
Since their latest blog post on deprecating APIs does not say anything about getting rid of the web host feature, you are probably fine.
If so, what is the expected timeline of feature deprecation and eventual disappearance?
If the APIs they're deprecating are anything to go by, even if they do get rid of web hosting it will be a couple of years between the time they announce it and it actually being unavailable. It's not a perfect comparison since those are entire APIs and this is just a feature but it doesn't seem like they make a habit of making something unavailable at the drop of a hat.

How to access information in Windows Device Manager from Java?

I have a serial to USB device and more than one of those can be connected to the computer. I need to query and retrieve a list of COM ports that the devices are connected to. In Windows Device Manager you can get the COM port + friendly name of devices that are connected at the present time. This list is dynamic.
Reading from the registry did not work because the information stored is stale and static, not dynamic.
Devcon (from Microsoft) does list the ports that devices are connected to, but it cannot be used in my app because it is not re-distributable.
Any ideas or preferably, a solution?
I had to solve a similar issue just some weeks ago. I came accross the Jawin-Project that provided everything you need to use WMI-Queries. It is already quite old but works like a charm if you follow the documentation. A nice German walkthrough can be found codegods blog.
For me, it did not solve all problems (I had some very specific things to find out about the target device), I finally created an own JNI (Java Native Interface) Class and DLL in C incorporating the windows API.
I hope this is what you searched for.
Did you try this jUSB API or This example ?
I hope this will help you.
Use JNA (https://github.com/twall/jna) and take a look at the following page. It might be a useful point to start from.
http://www.digitalinferno.com/wiki/Wiki.jsp?page=JNAPrintDevices
I am looking at Java Native Access as it provides access to the windows API from pure Java code - no JNI to deal with. I was concerned about the LGPL license; whether it can be included in a commercial product but from what a few posts in the newsgroup say, it can be.
After I try it out in the next few weeks, I shall post back here.

Youtube API impossible on android?

I've been having tremendous problems with connecting my android app to the youtube API. Firstly I tried to go along the route of using the native youtube gdata java client(http://code.google.com/p/gdata-java-client/). I had read that this could then be integrated into an android app easily enough and so I set about doing that but I would stumble every time at the line
YouTubeService ytservice = new YouTubeService("AppName",Dev_Key);
I'd enter the correct details here, even have all the necessary external jars but every time I would be given a NoClassDefFoundError reporting that YouTubeService could not be found and neither could it's superclass, MediaService. (Just so you know, I had gdata-youtube-2.0.jar, gdata-client-1.0.jar, gdata-media-1.0.jar, guava.11.0.2.jar and jsr305.jar)
So then I tried which appeared to support android (http://code.google.com/p/google-api-java-client/wiki/Android). There was even a sample example where google tasks had been integrated so it looked promising. It didn't have an actual YouTube class like it did have a taskService but it did support OAuth 2.0 login which I could work with by just sending off URL requests to the youtube API with OAuth 2.0 authentication. I tried this but when the only key I could get from it in combination with android's AccountManager was an auth key token. Posting this with the URL request to google resulted in an 'authentication required' response from youtube(because i was providing an incorrect access token, it was at least twice the size of a working access token i was comparing it with).
How can I find the access token that I need for the youtube API from the AccountManager? Or even better, how can I get the YouTubeservice to work?
Thanks
rory
Edit
Amad, thanks for the answer but unfortunately that is what i am already doing:
(source: themobilelook.com)
maybe it'll help if i supply my project folder: here it's a barebones setup, literally just to test if the YouTubeService works.
using adt 20, jdk compliance level 1.6
if you manage to create a working version then itnwoild be great if you could share it
The YouTube API library/libraries must be included in the project. By going to the Project Properties > Build Path > Order and Export tab, you can tick the checkbox next to the all YouTube-API-related libraries to ensure that they will be included in the project when you export it. Make sure to clean and rebuild after doing this.
As for the access token... not totally sure. The documentation may help there. This Google Groups thread may help also.
If you get NoClassDefFoundError during Runtime, then I suspect you did not include them to work at runtime. You have to check the checkbox for each .jar like this:
(Of course you have to add them to your java build path first)

Categories