Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 35    Views: 85

richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
09/12/14 02:42 AM (9 years ago)

Smug's Android HTML

My android version of Hinan Magazine is now on Google Play. Luckily I never publicized this as I have just downloaded it and the HTML links are not working. They worked fine, that is the links worked fine, in testing but now that its gone live they don't seem to work. There is about 30 of them. They all link through the BT file manager. Also, this happened on testing but I thought is was just a testing thing, when the links were working in the test each time (on emulator as well as device) the app crashed but reloaded straight away and the link to the page was fine.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/12/14 03:08 AM (9 years ago)
Let me snoop through some code and let you know if I come up with something. Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/12/14 03:29 AM (9 years ago)
Hi Smug. I have spent some time on this now and I think the problem is the URL is not linking to BT. I had a problem lunchtime with BT. My Firefox said there was a security breach and did I want to link insecurely. I said yes and have not had a problem since (on my Mac).
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/12/14 03:40 AM (9 years ago)
Well, the BT server certificate expired today. In fact, while I was working on a project with someone. We noticed it out here first in Asia, but Europe and the US will soon be talking about it if it's not changed soon. Let me know how it goes! Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/12/14 03:43 AM (9 years ago)
Is it going to be renewed? Just my luck. Talk about circumstance.
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/13/14 02:31 AM (9 years ago)
Hi Smug Sorry to bother you. The URL's are still not being read by my app. I just dragged one to my desktop and it opened in Safari no problem. Could you possibly check and see if its working from your end? https://www.buzztouch.com/applications063014/JA7EE69D5730CF94FB5660389/documents/whitewater.html I just tried on my phone and it, via the internet, could not be found. Thanks Richard
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/13/14 06:45 AM (9 years ago)
Unbelievable!! Stop the press. All the links started working about an hour ago. That's nearly 30 hours after I uploaded it from the Google Play store. A big sorry to Smug and thanks to him for all his patience.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/13/14 08:12 AM (9 years ago)
No problem! You made me go through the code a little more, and I was cleaning up some stuff that, while not exactly problematic, certainly could use some housekeeping. I might even make it pretty enough to publish an update, lol! Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/14/14 11:28 PM (9 years ago)
Hi Smug There is one thing, which a casual user may not be aware of, but each time I tap to go to a page with the HTML link it crashes the app. I know to tap ok and retap the app icon and reopen the page as it downloads but a new user may either give up or tap the report button. Once the page has been opened it stays in the cashe to be reused as and when but not before it goes through the above process.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/17/14 12:43 AM (9 years ago)
That's been fixed in the most recent update. Give it a whirl and let me know. Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/17/14 01:40 AM (9 years ago)
Hi Smug. How would I refresh the plugin? And can I do all of them at once? Richard
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/17/14 02:11 AM (9 years ago)
Well, if your project is in the BT server, it's already updated. If you're self hosted, you'll want to go to the admin panel, select plugins and choose "look for updates" and it will let you know which plugins have updates available. Be sure to select 'refresh' after adding or modifying any plugins. This needs to be done regardless. But the project on your desktop that you've worked on doesn't have the updated code. So your decision is to either download a 'fresh' copy of the code with the updated plugin(s) and build it over again, or import new code into your existing project, and make the changes to eliminate errors. When I say 'errors', it's because "raw" plugins are sort of generic in some ways. Consider this: when you download a project from the BT server, it modifies the code to reflect your project name throughout the code in the project, including plugins. What happens is basically the BT 'machine' does a big 'search and replace' looking for certain 'keywords' that need to be modified. Most notably "BT_appDelegate" is turned into "yourAppName_appDelegate", and by default, the android source tree is "com.buzzTouch" until it gets changed to "com.yourAppName". Anyway, to make a long story longer, I'd say keep your current project if you've done a lot of modification, and just copy/paste new code and make the changes needed to cure the errors. 1) look for "BT_appDelegate" and change it to "yourAppName_appDelegate" 2) at the top of the file, find "com.buzzTouch" and change it to "com.yourAppName". You can find examples in almost any other class file in your project. But let me know if you have questions. Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/18/14 12:53 AM (9 years ago)
I have just checked the app in Eclipse and the changes have been made. But they are having no effect on the app itself. I never changed anything but every case of appDelegate is now hinanmagazine_appDelegate and com.hinanmagazine is at the top of every class file I opened.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/18/14 01:32 AM (9 years ago)
Are you getting any errors? Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/18/14 02:46 AM (9 years ago)
No error messages. But no change to the app on my phone - will I have to rebuild?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/18/14 03:23 AM (9 years ago)
See, that's a part of your development process I'm unsure about. In 'my' environment, I make changes to my code, and with my device connected to my computer, I run my app from eclipse, and it runs on my phone (instead of a simulator). I can change a couple of lines, save it, rebuild and test pretty quickly. If your environment doesn't work that way, you might have to create a new apk and try it that way. Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/18/14 03:36 AM (9 years ago)
The app is already running on Google Play and I have given instructions how to close the app and reopen straight away. But if I rebuild (and there are 63 HTML files to rebuild)then I am sure all will be fine but at the moment I can't face it :)
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/19/14 05:01 AM (9 years ago)
Hi Smug Just made a new test app. There are no error warnings but there are 25 warnings. AppName_appDelegate is in place as is com.AppName at the top of the class files. However, the same problem still arises. I downloaded the APK file and opened it on my phone and the app crashes the first time I open a link. I made the test app with two links and that is what happened on opening. Then I created a new page in the control panel and saved it and the same thing happened. It crashed on opening and had to be reopened to show the page. Richard
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/19/14 03:52 PM (9 years ago)
Are you BT hosted or self hosted? If you look at the very top of the sw_androidHTML.java file, which version does it reflect? Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/19/14 08:43 PM (9 years ago)
BT hosted. Version 1.3 Sept 17th 2014. So it is the latest I'm guessing.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/20/14 03:47 AM (9 years ago)
Yep; that's the latest. Odd... I don't have any issues. I created a little video of me loading your page onto my device... https://dl.dropboxusercontent.com/u/115208762/sw_androidHTML.mov Try cleaning your project and trying again... If it happens again, let me see what the logcat says about it. Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/20/14 09:10 PM (9 years ago)
Hi Smug Sorry for the delay. Just had Eclipse crash on me...... Anyway, I can't attach a device to this Mac so I had sent an APK file to my phone. But I have just used emulator and the same problem exists. Here is the LogCat when I tap a menu button for the first time, the first line is in orange the rest is in red: 09-21 03:58:48.440: E/cutils-trace(1222): Error opening trace file: No such file or directory (2) 09-21 03:58:48.768: D/TilesManager(1222): Starting TG #0, 0xb8d03a10 09-21 03:58:48.768: W/PicturePileLayerContent(1222): Warning: painting PicturePile without content! 09-21 03:58:49.364: W/PicturePileLayerContent(1222): Warning: painting PicturePile without content! 09-21 03:58:49.544: W/PicturePileLayerContent(1222): Warning: painting PicturePile without content! 09-21 03:58:49.756: W/PicturePileLayerContent(1222): Warning: painting PicturePile without content! 09-21 03:58:50.740: W/ZZ(1222): SW_androidHTML: loadDataString 09-21 03:58:50.740: W/webview_proxy(1222): java.lang.Throwable: Warning: A WebView method was called on thread 'Thread-113'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads. 09-21 03:58:50.740: W/webview_proxy(1222): at android.webkit.WebView.checkThread(WebView.java:1918) 09-21 03:58:50.740: W/webview_proxy(1222): at android.webkit.WebView.loadDataWithBaseURL(WebView.java:847) 09-21 03:58:50.740: W/webview_proxy(1222): at com.hinanmagazine.SW_androidHTML.loadDataString(SW_androidHTML.java:262) 09-21 03:58:50.740: W/webview_proxy(1222): at com.hinanmagazine.SW_androidHTML$DownloadScreenDataWorker.run(SW_androidHTML.java:421) 09-21 03:58:50.872: D/AndroidRuntime(1222): Shutting down VM 09-21 03:58:50.872: W/dalvikvm(1222): threadid=1: thread exiting with uncaught exception (group=0xa4c34648) 09-21 03:58:50.880: E/AndroidRuntime(1222): FATAL EXCEPTION: main 09-21 03:58:50.880: E/AndroidRuntime(1222): java.lang.NullPointerException 09-21 03:58:50.880: E/AndroidRuntime(1222): at com.hinanmagazine.SW_androidHTML$1.handleMessage(SW_androidHTML.java:378) 09-21 03:58:50.880: E/AndroidRuntime(1222): at android.os.Handler.dispatchMessage(Handler.java:99) 09-21 03:58:50.880: E/AndroidRuntime(1222): at android.os.Looper.loop(Looper.java:137) 09-21 03:58:50.880: E/AndroidRuntime(1222): at android.app.ActivityThread.main(ActivityThread.java:5103) 09-21 03:58:50.880: E/AndroidRuntime(1222): at java.lang.reflect.Method.invokeNative(Native Method) 09-21 03:58:50.880: E/AndroidRuntime(1222): at java.lang.reflect.Method.invoke(Method.java:525) 09-21 03:58:50.880: E/AndroidRuntime(1222): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 09-21 03:58:50.880: E/AndroidRuntime(1222): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 09-21 03:58:50.880: E/AndroidRuntime(1222): at dalvik.system.NativeStart.main(Native Method) 09-21 03:58:55.096: I/Process(1222): Sending signal. PID: 1222 SIG: 9 This causes the app to close and I have to reopen the app and tap the page again to open it.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/23/14 03:54 AM (9 years ago)
Hi Richard. Sorry for the late reply; I've been perusing my code trying to figure out why it works for me and not for you. At the moment, I'm at a loss. Can you just build a simple test project from scratch, and see if the symptom remains? If indeed you have the latest version you 'should not' experience any issues, either from local documents or dataURL documents. I've vetted both and they seem to work just fine. But I don't want to leave you out there hanging either, so let me know how it progresses. Android is it's own particular burden, but we want to make sure that we're not contributing. Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/23/14 10:06 PM (9 years ago)
Hi Smug Thank you for all your effort on this. The latest test I did was last Saturday or Sunday and the results were the same. I will forward you the APK file this Friday (it's on another Mac which departed for Nan on Sunday evening but I will be there on Friday so I will send it to you then) and you can check out what is different. It is not very big just a main menu with three working extensions. Richard
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/23/14 10:29 PM (9 years ago)
I wont be able to trouble shoot an APK. Can you zip up your project and let me look at it? Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/23/14 10:55 PM (9 years ago)
I can send you the zip file no problem but again it will have to be Friday I'm afraid. If I create a new one it may be different and would defeat the issue I guess.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/23/14 11:03 PM (9 years ago)
As long as the project includes the most recent version of the plugin... If the project you're currently using is not utilizing the recent update, then that is why you're experiencing the same issues. When you have the opportunity, email it as an attachment to smugwimp at smugwimp dot com. Make sure your subject line is unique and contains the word 'buzztouch' otherwise it may get accidentally tossed... Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/26/14 06:14 AM (9 years ago)
Hi Smug Sorry about the delay. Here is the temp zip file you were after. https://www.dropbox.com/s/n7ur5gxz21bi2sb/hitemp_Android.zip?dl=0 Hope it works. Richard
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/26/14 02:41 PM (9 years ago)
Richard, Apologies; I've seen this happen, and I'd have sworn I took care of it in 1.3, but I must be mistaken. In the 'downloadScreenDataHandler' method, around line 380 or so, comment out the following: /* documentIconView.setVisibility(View.VISIBLE); openWithButton.setEnabled(true); downloadButton.setText(getString(R.string.refreshFromURL)); //change click handler of download button to confirm refresh... downloadButton.setOnClickListener(new OnClickListener(){ public void onClick(View v){ handleRefreshButton(); } }); */ Make sure that takes care of it. If it does, I'll update the plugin in the market. Kind Regards, -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/26/14 10:25 PM (9 years ago)
Hi Smug Doing that brought up 3 errors. I managed to get rid of 2 but in the last line //return.... return super.onOptionsItemSelected(item); } The red x appears on the closing bracket } If I delete it it then highlights the semi-colon and if I delete that it goes to the last bracket behind item. There is no opening bracket before //return but by putting one in does not make a difference. The file won't clean with this one error. Richard
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/27/14 01:12 AM (9 years ago)
Hmm... well, In my Eclipse environment, using your test app, I get pages for "WangSiLaLang" and "Moshi Moshi", that seem to download, cache, and display. "Nan Map" comes up as a blank plugin, so I'm assuming it's not an HTML. However, all works fine. I zipped up a java file; with eclipse "not" running, remove the current SW_androidHTML.java file and replace it with this one, and let me know if your experience is the same or different. https://dl.dropboxusercontent.com/u/115208762/SW_androidHTML.java.zip And what kind of device? On my Galaxy Tab 2 7" (Android 4.2.2) it's flawless... Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/27/14 01:38 AM (9 years ago)
Yipee - that works perfectly. The errors were probably Eclipse playing up as per usual. I will now try that on the Hinan Magazine App create an APK to test and see if it works before uploading to the Google Play Store. The Nan Map is a location plugin - I am going to attempt to do the map for Android again - ha ha. Looks wonderful on the Apple app though. I am using my new phone to run the test apps on - a Samsung Galaxy Core 2. Cheap and cheerful. The camera is not that great but for the price (about $85) can't complain. Thanks Smug for all your hard work on this.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/27/14 03:36 AM (9 years ago)
Glad we got you back on the street. I'll make those changes and update the plugin as well, so no one will have future occurances. But I might suggest that you work through whatever it takes to be able to have your device connected to your computer and run your apps from Eclipse/Device without having to 'formally' compile and load an apk... It's much faster, and the logcat is definitively an asset to have while testing. If you can't, well, so goes life. But things could be far easier for you if you can implement it. Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/27/14 04:57 AM (9 years ago)
Well the HTML plugin is working perfectly now. Shame about the menu with image (bloody eclipse problem I guess) - it may just be the slow internet connection here in Nan but I don't think so because the URL's are all working well and reasonably fast. If the images don't show up by the morning I will put out a forum wide question I guess. Never had this problem before with the menu with images though.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/27/14 05:53 AM (9 years ago)
I tried to take a look, but in the sample you provided, you're using a simple menu, not menu with image. Give Susan a yell and see if she can provide some guidance... But I do know her stuff works fine on both iOS and Android; it may just be an odd configuration that needs a second look. Cheers! -- Smug
 
richardemery839
Aspiring developer
Profile
Posts: 258
Reg: May 15, 2013
Bangkok
9,480
like
09/27/14 08:42 PM (9 years ago)
That is the only difference between the test app and the one for the magazine. I have just put the question in the plugin forum. It is very odd though. I have been using menu with image for ages with no problem at all.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.