Mapping natively not working - codenameone

i have 2 days trying to make native google maps to work. I followed all the instructions i found, nothing. I searched for 2 days if others had any problems, i followed their solution but still nothing.
Maps appear on the simulator but not at the telephone. I tried with a dialog nothing. I tried to a container to the main form nothing.
I also tried final MapContainer cnt=new MapContainer(new GoogleMapsProvider("my_api_key")); but still nothing. With this i couldn't see the maps neither to the simulator.
I have downloaded from git first and then from the extensions but still the same. Nothing shows up.
Google api console shows the requests every time i try to see the map, but no map on mobile. I also used with SHA1 and without. The same results.
I noticed that in BuildHints it automatically adds android.playService.maps=true, and when i tried to add the android.includeGPlayServices=true there is a build error, cannot be used together the error log says.
My codanameone plugin version is 3.5.8
Thanks in advance.

You need to have a google API key using this build hint:
android.xapplication=<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="YOUR_ANDROID_API_KEY"/>
ios.afterFinishLaunching=[GMSServices provideAPIKey:#"YOUR_IOS_API_KEY"];
You need to login to the google cloud API console and turn on map support for your application picking "native Android" and then "native iOS" then copy the key for each and replacing the strings YOUR_ANDROID_API_KEY and YOUR_IOS_API_KEY respectively.

Go to the Google developers console to check your credentials.
https://console.developers.google.com/apis/credentials
Be aware that you need to remove the key restriction to make the API key work with Codename One.

Related

How to migrate an online angular script to local server?

Hi I'm trying to make an offline version of this page:
https://u-he.com/tools/microtuning/ the script is writtin with Angular JS how do I do that?
I saved the page control-s and copied the file to the local server I'm running.
And then I browsed the local ip. the page opened but I get repeated notes ng-repeat shows up as multiple boxes instead of 1 box that edits the same note but in different octaves.
How do I solve this problem please.
You can inspect the front-end code in your browser console. In Firefox it's in the section called "Debugger", in Chrome it's called "Sources". If you use Safari, you need to enable Developer mode first.
Once you have the appropriate view, just click on u-he.com -> tools/microtuning/ -> index
Hopefully it goes without saying that you shouldn't use large swaths of another person's code without at least giving appropriate credit, or better yet getting the developer's permission, unless there is an explicit open-source license.

Using a custom domain on GAE. Won't let me past Step 4

I'm trying to use a custom domain with a static site hosted on AppEngine. Once I get into Google Apps to add the domain, I just get stuck on this page. Basically, I can't get past Step 4 as per the instructions here. I click "Accept" and hit the activate button but the page just refreshes. I spent about a half hour on the phone with "Lewis" from Google phone support and he eventually told me to try App Engine support lol. During the support call we attempted to get this to work multiple times using both the latest Chrome and FF browsers with cookies/cache, etc. cleared.
No reputation, so no screenshot but like I said, the problem is at Step 4 where you have to accept GAE's terms.
Looks like similar problem here. Anyone have the same problem and/or know of a solution? Thanks
You can try other way to activate, like a html page.
I have used this method to activate.
My activated page seems those:
By html to activate => //i.stack.imgur.com/t3nM1.png ;
By operators to activate =>//i.stack.imgur.com/fZTWH.png;
Can you see them?
By the way, I am in China, so, these uploaded images that I can not see them.

Browser Automation with Selenium: Fingerprints, recognizability and traceability?

I want to use selenium/webdriver to simulate a browser and scrape some website-content with it. Even if its not the fastest method, for me it has many advantages such as executing scripts etc.
For many websites it is forbidden to access them via an automated method, for example search engines like google or bing.
For one tool i need to scrape the estimated resultstat from google for several keywords. This will look like the following: simulate the browser that visits google.com and types in a keyword and scrapes the results, then after a little pause type in the next keyword, scrape the results and so on...
My question is: Is it possible for a website to recognize that I'm using selenium to simulate the browser instead of using the browser by hand? Especially the google case gives me some doubts. I know selenium is partly developed by google or at least by some guys working for google. So does leave selenium some fingerprints or isn't it possible to decide if I'm using the browser by myself or simulated by selenium, even for google?
No, nobody can actually see that you're using Selenium and not hand-operating the browser yourself with WebDriver. I'm not sure about the old Selenium RC, but it should be the same way. Here's how it works:
Selenium opens up a browser with a clean profile (or with a profile you selected)
Selenium is hooked up to the browser so it can steer it, control it. But the browser still does most of the work. Basically, Selenium replaces the user inputs to the browser, but not more.
You can easily verify this by reading the contents of the HTTP headers sent by your browser.
If you ever actually needed Selenium to be recognized by your server, you can use Browsermob-proxy and add a custom header to your requests.
All that said, there is one thing you must be aware of. While there's no way to detect Selenium directly, there can be some indirect clues picked up by the website you're visiting. Those usually include scanning for too many requests made in virtually no time - this might be an issue for you. Make sure your Selenium is behaving like a user.
EDIT 2016/04:
Apparanetly it is possible as https://stackoverflow.com/a/33403473/2930045 states that a company can do it. My guess - and it is nothing but a guess - is that they can run some JS that Selenium installs into the browser to operate.
Signs point to yes, sites are able to regonize that you are using Selenium.
Counter Example: www.stubhub.com detects and blocks my browser instance launched using Selenium while "normal" browsing done manually (not using the browser launched by the Selenium web driver) work with out issue.
See this stackoverflow question for additional details
Can a website detect when you are using selenium with chromedriver?

Google App Engine Channel API and Chrome Extensions

Over Christmas I implemented some code to open a channel to my App Engine application using the channel API and it was working fine.
I recently returned to the code and find that it is broken, and the problem seems to lie in talkgadget that the client code is trying to load into a frame.
I took a snapshot of the code returned by /_ah/channel/jsapi on December 21 and I am comparing it to today's code.
When the older version tried to get talkgadget.google.com/talkgadget/d?token=[my-token] it was hardcoded to use http. Sensibly enough, the code was later changed to check the page's protocol in document.location and adapt to cases where https is used. The problem now is that when running in a chrome extension it grabs chrome-extension: as the protocol and naturally the channel fails to open in the extension.
Setting the base of the background page to my appspot URL does not change document.location, although I had some vague notion that it should. (Not sure what the standards say.)
Is there a workaround for this? One thought was to create my own iframe loaded from my site, but then it will nest the actual channel iframe, complicating things.
I wonder if Moishe or someone else on the App Engine team could comment on this. It seems like the this is a bug and the code should take into chrome extensions either by testing for the protocol and searching for a base tag as an alternative, or provide some way to configure this through the javascript object.
Yep, this is a bug. There's a fix submitted, and it's in the process of rolling out to production; it'll probably be out in about a week.
In the meantime, your idea of an iframe embedded in the extension should work.

SmartGWT - Appengine - 404 not found

Im using smartGWT v2.1 with GWT 2 and Appengine SDK 1.3.0
On localhost, everything works fine!
When I deploy everything goes fine too, without any error!
The problem is, when i access the the app it returns an blank screen. Using the firebug i saw just nocache.js missing.
ErrorLog:
GET mika.nocache.js
http://perfworker.appspot.com/Mika/mika.nocache.js
404 Not Found
perfworker.appspot.com
Just to know, the last version of smartGWT should work on AppEngine out of the box?
Thanks in advance!
Cleber
I'm going to guess you're developing on Windows. NTFS, unlike nearly every other filesystem, is case-insensitive, so it'll work fine if your file or directory has one capitalization and you're accessing it with another. On every other platform, however, including the one App Engine runs on, capitalization matters: Check that you're using the same capitalization to access the file as is used to name the file.
Btw, this not only applies to SmartGwt, but to any GWT app. I would have voted on the answer above, but I don't have enough rep points yet [new user]. Changing the casing of the link in the base html page worked for me.

Resources