Comments (13)
To solve this problem, please manually download the plug-in package and put it into the plugins folder under the Android studio installation directory. It will take effect immediately and will not remind the plug-in error if it is started again
from android-parcelable-intellij-plugin.
I've been able to get it to temporarily work for the current session if I first manually delete the plugin jar from here (if on Windows):
C:\Users\{username}\AppData\Roaming\Google\AndroidStudio4.1\plugins, and then using the "Install Plugin from Disk" option to manually re-install the plugin jar. Doing this, the plugin appears to then be accepted and usable. However, once you close and relaunch Android Studio, you'll encounter the same incompatibility error and auto-disabling of the plugin, so you must do this each time. It's very frustrating.
from android-parcelable-intellij-plugin.
I've been support for android studio 4.1, please download this.
https://github.com/raedev/android-parcelable-intellij-plugin/blob/fix_4.1/android-parcelable-intellij-plugin-4.1.jar
from android-parcelable-intellij-plugin.
No plugin is needed, just write implements Parcelable in the class and you should see one red bulb click on that you can see an option "add parcelable implementation" select that and parcelable code will be generated
Android Studio 4.1 has inbuilt support, I am using Android studio 4.1.1
from android-parcelable-intellij-plugin.
To solve this problem, please manually download the plug-in package and put it into the plugins folder under the Android studio installation directory. It will take effect immediately and will not remind the plug-in error if it is started again
You rock! If anyone is confused, there's the User's AppData location where plugins are normally installed to via the plugin manager (as per my comment above). However, if you place the plugin jar into the Android Studio app installation directory, such as "C:\Program Files\Android\Android Studio\plugins" on Windows, then it works as expected for every session thereafter, just as dgy5258565 described!
Couple notes:
- Do make sure to delete it from the User's AppData location first.
- I suspect this may need to be redone on upgrades to Android Studio if that process wipes unexpected plugins from the installation directory.
from android-parcelable-intellij-plugin.
The Android Studio implementation option does not work (at least on my case) with all types of objects. It does't write code for Dates, BigDecimals, enums, etc.
from android-parcelable-intellij-plugin.
I use this plugin all the time, making it compatible with Android Studio v4.1 would be a lifesaver!
I'm on macOS Catalina Version 10.15.7.
from android-parcelable-intellij-plugin.
-- edit --
Scratch that.
If I'm getting downvoted explaining how exactly the same behavior is already inbuilt in Android Studio I'm going to do s***
Go install a jar from some chinese dude then.. xD
I wish you hadn't deleted your original post, as it was helpful and I learned something from it. I also wish those who downvoted you would've replied stating why they prefer the plugin vs what you suggested. Aside from that, I'm not sure why you're bringing up ethnicity or why that matters in the land of software development. I realize you're upset because of the downvotes, but maybe avoid talking that way in general, as it comes across very negatively.
Anyways, as I said, I honestly didn't know Android Studio had this built-in now! Albeit behind the context options and not generate options. The generated code is a bit different but does appear to look good, so I will try this out next time I need to implement Parcelable. And don't take this the wrong way, but I'm going to re-post what you had deleted, as it may help others to know of alternatives available now, as it did for me.
Original post:
Android Studio (4.1) supports creating and implementing all required methods for Parcelable by default, no need for this plugin anymore.
Add "implements Parcelable" to class definition
Click the red light-bulb and choose "Implement methods", click "OK"
Click the class definition (red class name), click the red light-bulb again and choose "Add Parcelable Implementation"
I'll add to this that you don't require seeing the red light-bulb, but simply Alt+Enter (on Windows) to get context menu on the class name is enough to see new "Add Parcelable Implementation" as well as "Remove Parcelable Implementation" if one is already provided.
Cheers!
from android-parcelable-intellij-plugin.
The Android Studio implementation option does not work (at least on my case) with all types of objects. It does't write code for Dates, BigDecimals, enums, etc.
Thanks, I'm seeing same behavior out of the box, silently omitting them. I wasn't at first because I actually had a Parcelable implementation on my enums, of which the AS implementation doesn't generate correctly for either. I have not tested it, but diving through Parcelable code seems to appear to line up in allowing these to work if I write my enums to implement Parcelable like this example:
public enum ApprovalStatus implements Parcelable {
APPROVED,
FEATURED,
PENDING,
REJECTED;
public static Parcelable.Creator<ApprovalStatus> CREATOR = new Parcelable.Creator<ApprovalStatus>() {
public ApprovalStatus createFromParcel(Parcel source) {
return ApprovalStatus.values()[source.readInt()];
}
public ApprovalStatus[] newArray(int size) {
return new ApprovalStatus[size];
}
};
@Override
public int describeContents() {
return hashCode();
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(ordinal());
}
}
Then on a class utilizing this enum, generates the following Parcelable code:
approvalStatus = in.readParcelable(ApprovalStatus.class.getClassLoader());
and
dest.writeParcelable(approvalStatus, flags);
Although, I don't have any recommendations for Date and BigDecimal, apart from extending them to custom classes and providing a Parcelable implementation too, if that's possible.
from android-parcelable-intellij-plugin.
support android studio for 4.1.1
https://github.com/linjson/android-parcelable-intellij-plugin/blob/master/ParcelableCodeGen.jar
from android-parcelable-intellij-plugin.
No plugin is needed, just write implements Parcelable in the class and you should see one red bulb click on that you can see an option "add parcelable implementation" select that and parcelable code will be generated
Android Studio 4.1 has inbuilt support, I am using Android studio 4.1.1
Thanks, but this and reasons to not trust that method have already been addressed above. Unfortunately this plugin is still superior to the official built-in method in some ways. For now at least.
from android-parcelable-intellij-plugin.
Can you please shed some light? about the benefit provided by the plugin than inbuilt support, which will help others
from android-parcelable-intellij-plugin.
Can you please shed some light? about the benefit provided by the plugin than inbuilt support, which will help others
Meant to reply a long time ago, but as I said in my original reply, it's all explained above. I'll repeat the short of it: the built-in one doesn't work for all cases. It fails on Dates, BigDecimals, enums, and probably others.
I also personally find it cumbersome to generate the code since it doesn't use the "generate" context menu.
Hope that helps answer your question.
from android-parcelable-intellij-plugin.
Related Issues (20)
- runtime exception when readList
- NullPointerException: null HOT 4
- android studio mac 配置环境 HOT 1
- There is no Preferences -> Plugins -> Install plugin from disk....
- Parent class CREATOR is miss when i parcelable with it in child class HOT 6
- Object is not parceled correctly if it has a field of an array of its own type HOT 1
- Not work in Andriod_studio_window_x64_2.1.2
- Generate final parameters where possible? HOT 2
- short[] causes broken code HOT 4
- Enum support HOT 3
- Code formating
- Generate code with parent object from library
- After installing, plugin not visible in AS 2.3 HOT 1
- [Question] Why the generated constructor is protected rather than private? HOT 1
- Error writing a list of Parcelable objects with subclasses
- How to parcel private List<T> data; HOT 1
- Request: support Kotlin too
- Android Studio 3.0 not work HOT 10
- when map is null. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-parcelable-intellij-plugin.