I have lost much time solving this problem, and looks like I'm back at the beginning.
I want to run the full screen ADs from the Mobclix inside my Unity3D game. I found many tutorials but I can't get any of them working.
As far as I know, there are 2 approaches:
1.) extending unity player
2.) make JAVA side method for showing the AD's and just call it from the unity(c#)
Most important for me is to make it work, but I would prefer 2. approach.
Can somebody suggest me something and maybe give some hints/examples what am I missing?
I tried both ways. I made an JAVA plugin but when I try to call a method nothing happens or I got an error from JNI something like: "can't find that method", my manifest is not configured correctly, or my app crashes.
If I'm making a plugin (not extending UnityPlayer) do I need to add something to the manifest to support my activity/make my class able to call inside unity? How would the manifest look like? Can it be done that way?
If I'm extending the UnityPlayer how would mthe anifest file looks like and how can I call my method for that will show ADs?
I tried to call java/android methods from the unity/c# and that worked, but when I try to call my own simple method from the plugin it won't work. Looks like I'm missing something in that part. (connecting the JAVA plugin and the unity3d)
I'm experienced in the C#, but my JAVA knowledge is really at the minimum. I'm sure this can work (there are people that are selling solutions) but looks like I'm not smart enough and keep missing something :)
I tried many things, I stopped counting and deleted most of them. Can somebody tell me the right way to do this? A working example would be really useful...
Thanks for taking the time to read all of this, I hope there will be some useful responses because I'm starting to get depressed :)
Unfortunately, it looks like the absolute easiest way is to purchase a plugin, made just for this. I found one here, which costs $50, and it specifically stated it supports fullscreen Mobclix ads.
There is a free one developed by the staff at Unity3D forums, however, it seems more complex, in that you must run it on the actual android device, and I am not sure if it supports full screen. You can find the discussion thread here.
Hope these links helped!
Edit: I found a much more affordable £6.00 Unity3D plugin, which you can get here. It did not explicitly state support for fullscreen, however.
Note: I found a tutorial from the very same website that offers the £6 plugin. This tutorial might be worth checking into, however it involves compiling your own Unity Android plugin. Because it is from the same website, it may be worth checking into. It is specifically a plugin to display Mobclix ads on a Unity3D for Android app.
Related
the problem is, i use OP5T, and none of any 8.0/8.1 stock custom rom does support 18:9 scaling feature like in OOS, this feature named as "Full Screen Apps" under app category.
after a few googling, i came up with these method:
1.) add/inject/force this into manifest file of every installed app. or maybe doing some workaround with the packagemanager
meta-data android:name="android.max_aspect" android:value="2.1"
2.) playing inside AOSP source code, parsePackage method.
frameworks/base/core/java/android/content/pm/PackageParser.java.
i know nothing of creating xposed module, but before starting my journey, is it possible to do the first method with xposed?
after seeing module like Xinstaller, App Settings, and XAspect. i thought it may be possible with xposed to approach this.
really appreciate every kind of help, thanks before
Xposed Framework can do this!
Xposed cannot edit manifest xml files directly, but it can indeed do the way 2.) you proposed:
Xposed Framework can "hook" any method to execute arbitray code before/after/replace that method. You are indeed on the right track, and PackageParser.java seems like the right class : I'm not so sure about the parsePackage() method though - a glance at AOSP seems to suggest that perhaps the method parseMetaData() might be a better candidate to hook?
Some background on Xposed -
You will need Java to create any Xposed modules. Android itself is based on (primarily) Java, so you will need Java knowledge to make Xposed modules.
As for Tutorials, Rovo89 (the creator of Xposed) has a simple tutorial here at https://github.com/rovo89/XposedBridge/wiki/Development-tutorial. This tutorial is almost completely upto-date, and you can use this to create your first module.
You will find another detailed tutorial here - https://forum.xda-developers.com/showthread.php?t=2709324. Keep in mind that this link is very old, so wherever there are any conflicts, go by Rovo89's tutorial.
I've been searching for a couple of days, including on this website. What I have found would be useful, however I find that I'm unable to follow them correctly. The questions here have no answers either.
Firstly, when I attempt to add BasegameUtils to the project and import whats needed, Eclipse cannot find them. I don't understand why, because I have imported it and marked it as a library.
This is not helped by the fact that all of the examples have their mainactivity in the folder where the API is. I have already built a full application, and I do not understand where I'm supposed to put mine.
The whole thing is incredibly confusing, and any help, or examples would be lovely.
https://developers.google.com/games/services/android/init
You need to implement baseGameUtils as a library or module depending on your IDE.
public class Main extends BaseGameActivity
And then you call this to unlock the achievement.
Games.Achievements.unlock(getApiClient(), getString(YOUR_ACHIEVEMENT_CODE));
These code samples really helped me first time round.
https://github.com/playgameservices/android-basic-samples/tree/master/BasicSamples/libraries/BaseGameUtils
The tricky part isn't the code, it's the configuration of your project, make sure to check on the play developer console that you have set up your testing account properly and your achievement codes are correct etc.
Okay, the solution was not simple. The guides seem to favour Android Studio, which implement a script to create BaseGameUtils. The BaseGameUtild that I was importing with Eclipse was not the correct one. I ended up searching for a valid one, and downloaded it.
The second thing I was doing wrong was not updating the SDK to version 20. Now, with the Play Services Lib in the extras, I could import the updated version.
After that, I discovered that gms.; actually must be written as com.google.android.gms..;. With this in line, I am now able to properly implement everything.
Thank you to those who helped.
UPDATE 2
I posted an answer that fixes my original problem. See that for more information.
UPDATE
FYI for anyone wondering, in the end I found this: http://github.com/commonsguy/zxingdemo/tree/master Exactly what I needed to get it rolling was a simple demo that worked! Also, thanks to Sean for pointing me in the right direction for my googling.
I am currently trying to build a simple android app that can scan in a barcode. I have looked through multiple tutorials, tried everything to a T, and re-tried and re-tried. Nothing worked. So now I am going to ask for assistance to see where I went wrong.
To list the tutorials I have followed:
https://github.com/phonegap/phonegap-plugins/tree/master/Android/BarcodeScanner
Tried this one first.
http://www.mobiledevelopersolutions.com/home/start/twominutetutorials/tmt3
http://simonmacdonald.blogspot.com/2011/12/installing-barcode-plugin-for-phonegap.html
Plus a couple others, but more or less hit the point to the same process. Some key points, when I add the LibraryProject to my project as a Library, the app will not compile until I create an AndroidManifest.xml I tried using the one found in the LibraryProject and tried creating a bare mininmal one, both would allow to compile, but the app ForceCloses.
When I load up the App and click "Scan" it ForceCloses and in the debug log of LogCat in Eclipse I get:
java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.myapp/com.google.zxing.client.android.CaptureActivity}: java.lang.ClassNotFoundException:
com.google.com.zxing.client.android.CaptureActivity in loader dalvik.system.PathClassLoader[/data/app/com.myapp-1.apk]
I have tried googling, found a few issues, but no real clear or solid answers, most just point to the tutorials above. I am not sure if the tutorials are just outdated or I am being stupid and am missing something key. Been working on this for a few days now and am at my wits end.
If you can help I would appreciate it. To avoid answers regarding if I have done X or X, here is what I have done.
When I test the application, I do briefly see it trying to load BarcodeScanner, but right after I see that it ForceCloses. I am not sure what I am missing, but for references I will post the code I currently have setup to test:
AndroidManifest.xml - http://pastebin.com/qq9q0ZU7
Plugins.xml - http://pastebin.com/dZ5eKPSU
index.html - http://pastebin.com/wvht4ken
If I need to post any other items let me know.
On Android, it is much much simpler than all this you're trying to do. Throw this out and restart from http://code.google.com/p/zxing/wiki/ScanningViaIntent
Ok, so for anyone having this problem, you have two choices. You can use the ScanningViaIntent, as Sean pointed out. It works great, if you need an example look at CommonsGuy. As for the tutorials I posted above to get this working with PhoneGap, my whole problem was, after I imported the LibraryProject I did not go back through and add the files. I am not sure if a setting in my Eclipse is bad. But I basically just right clicked on the LibraryProject, went to Import -> File Structure -> Library Project's original project path, and loaded all of it back in there.
There is probably something wrong with my Eclipse setup, but yea. I now have the BarcodeScanner plugin for PhoneGap working!
I've got an android project that I started from an old standard Java project, so because of the vast difference in target platform, I have a lot of dead code to cleanup.
I've seen UCDetector recommended for finding unused public methods in java projects in Eclipse. I installed it as directed, and it just doesn't show up on the menu, and I have no idea how to get it to work.
Has anyone got this combo to work, or have another recommendation? Or know how to get it to show up?
(I've tried Find Bugs which found some good stuff, but it doesn't find unused public code.)
Big warning!
It might partially work, but beware, cause it doesn't seem to know about XML-defined callback functions.
If you have installed a callback function on a widget, say a button in an XML Style Sheet, and it is not called in code, UCdetector will think it has 0 references, and suggest it deleted. This obviously is wrong, and will render your code uncompilable.
There might be other similar issues, related to Android specifics.
Viggo
Yes, UCDetector works for android projects. I just installed it and it works.
It's available in context menu of project in Package Explorer.
I just dowloaded the Google IO Source code from here: http://code.google.com/p/iosched/ in order to understand the great UI of this app.
I also wanted to grab the code of the Twitter LiveFeed, but when compiling freshly downloaded code, I get a crazy UI:
I don't understand what's wrong as I didn't changed one line of the code!
Does this issue happens on other people devices?
Thank a lot.
I answer myself in case other people also searching for the answer:
http://twitter.com/#!/romannurik/statuses/69818965840506880
yes we used some custom Google
Realtime Search tweaks that I
explicitly removed from open source.
So that seem impossible for now... Or we will have to look for other alternatives