As you can see below, there is a different at the top of the screen.
(live app) this one is ok no, gap...
(test app) this one is not ok, has 20px gap...
So surely I cannot update my app if this problem wont go away. I am using OnsenUI here. The code is still the same, just the environment is new. I don't know if that has influence.
Previously I built with IntelXDK as IDE. All is well. Since IntelXDK is obsolete, now I just running test on a browser using command cordova run browser.
All is well, except when I test the code on my iPhone device.
Please shade some lights, thanks.
Related
I am a web developer and do not have any experience with developing mobile friendly websites.
When we are developing a mobile friendly website, do we need to create separate files for mobile version? Or can we use same files that we created for desktop version?
I recommend that you use one file set with a responsive design.
there are different ways to do this.
1) You can use bootstrap for that.
2) What I sometime do is that i use the css #media. Take for that a look at this link.
If you are going to develop a big site like flipkart, ebay or facebook, then its better you do separate mobile version, because such type of websites will take more time to load in mobiles. You need to display only relevant content in mobiles.
If its a simple website, better use Bootstrap.
Both you can make one file launch another, or have one big monster file.
How to detect Safari, Chrome, IE, Firefox and Opera browser?
But I think this might be more of what your looking for.
This is how I did it. It could fit only my design. My pages look like a blog page. The DIV floating left is the main content. Then I follow it with small DIV boxes for ads. The main DIV is 40em wide. And has side margins 4em each. That totals 48em = 768 device pixels.
So, I added the following meta instruction to every page:
<meta content="width=768" name="viewport">
That nicely gets the page on the smartphone, except the text is too small. The ads slide down to the bottom. Next, I went to my CSS file. There, I format my regular text with 'para' class:
.para {font-size:1.2em;line-height:140%;font-family:arial,helvetica,sans-serif;color:#333}
#media only screen and (max-width: 768px) {.para{font-size:2em;}}
The upper line is for PCs and the #media one is for phones. Notice that I increased the text size to 2em for the screen just 768px wide.
This all passes Google Mobile Friendly test. You can view-source my web site:
Read source-code of this and test it here.
NOTE: I keep changing my work. This site might be gone in few days.
Good luck.
my current project requires the implementation of Google StreetView.
The app already exists for iOS, where everything worked pretty fine, StreetView is embedded in the view, customized with overlays and buttons and what not...it runs fast, scrolling the StreetView view is smooth, it's obviously no webview...in short, it's perfect.
Now I have to do this app for Android and I was looking all day already, but with no success. From what I found out, there is the possibility to start StreetView as a new activity, without any chance to customize it, no overlays, no buttons, just standard Google stuff. This should be pretty smooth as it is not a webview. I can't use this, as I have to customize the UI.
Now I tried the webview approach and this makes everything slower and more laggy than you'd expect from even Android... BUT...seems to be customizable. Still, as slow as it is, I can't imagine anyone having fun with it.
So, my question is, do I have any more chances to get this working (a transparent Activity on top of the StreetView Activity? - please no)? Why does Google get it right for iOS and not for Android?
The iOS SDK just got released recently, is there a chance a new one will be coming for Android soon?
Thanks for any hints, M.
Found it. The answer lies herein : Android webview slow
Turning off the hardware acceleration speeds up the rendering ... yeah, right!
if (Build.VERSION.SDK_INT >= 11){
webview.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
I'm looking into the file upload on IOS6 and know that this is possible with the usual link:
<input type="file" accept="image/*" capture="camera">
Altho, the most tutorials and issues I can find are mostly about the upload function. In my case I need to be able to take a picture inside mobile safari with the build-in camera.
I have set up a page to test this (no code, only the link I posted above), and when I take a picture the app (camera app) crashes without actually saving my picture. Is this normal behaviour? Do I need to add some code to upload the picture first? Altho this last thing doesn't make sence to me, since you need to add an already saved picture to a file upload link.
Any help in this would be greatly appreciated :)
You should not need anything more in the code to avoid crash. It should work the same as choosing a picture from the library. I have tested this on an iPhone 4S with iOS7 and my Safari crashes too. It does not crash every time if I take a picture with the front facing camera (smaller picture?). It also works if I only load the picture from the photo library.
This is a bug in iOS I think. I managed to go around it by restarting my phone. Sadly there is not much we can do on the web side of things, except inform the user that the feature may be buggy.
Probably the best recommendation, until Apple provides a fix in a future update, would be to caution your user to close down the rest of their Safari tabs. (This lowers the memory usage and prevents Safari from crashing when doing the 'Take Photo' path through file upload).
On iPhone5 [[UISCreen mainScreen] bounds].size comes back as 320x480. Why. In all the posts I'm reading, people are saying that it returns the correct screen size. What is going on here? Am I missing something in the .plist file or something?
BTW I am hand coding the GUI, so there is no XIB.
Unless your app includes a Default-568h.png in it's bundle, it will run inside a 480 point high legacy screen sandbox on the iPhone 5, and can't draw or see any dimensions outside that sandbox.
Note that including this Default-568h.png is only allowed when building an app using Xcode 4.5 and the iOS 6 SDK (or, presumably, later) for submission to Apple's App store.
Added: When building with the iOS 8 SDK (or later) and running the app under iOS 8 (or later), a LaunchScreen.xib will also remove the 480 height sandbox.
It would appear that having a launch image in place is a prerequisite to [[UIScreen mainScreen] bounds] working properly on iPhone5. This is an issue for those of us dependent on design teams for our images. It looks like you just have to hack together a launch image and put it in place.
Is there really no better way? Anyone?
I have made my app with codename one.
I faced this strange issue:
I left my phone idle for a while and went to do some work.
After say about 15 mins, my screen had gone black while my app was still running.
SO when I activated the screen, all I got was a black screen. My app was nowhere to be seen.
The menu button also didn't work. I tried to again open the app, but again I got a black screen (the same state just got restored). So then I had to press the home button and force stop the app and then start it.
This behaviour is pretty arbitrary. I tried to reproduce it, but it's not something that happens all the time.
But, it does happen sometimes out of the blue.
What could be the reason for this? How can I prevent this?
Sounds related to this:
http://code.google.com/p/codenameone/issues/detail?id=154&can=1&q=wake
I'm guessing you are talking about an Android device right?
The application keeps running when suspended on an Android device, if something happened while the application was suspended it might fail on wakeup. If you can reproduce this file a bug, with the way to reproduce it (including code).
You can use the crash reporting system for paying subscribers (see the developer guide).
You can also install the Android SDK and use DDMS to inspect the device and see what fails (ideally with a debug build).