ecnu-icalk/autoskill/android-firebase-mixed-type-data-handling

Claude Code and agent skill by ecnu-icalk/autoskill

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Handle Firebase Realtime Database data where fields can be either Strings or Integers, ensuring the RecyclerView adapter and POJOs support both types and include node keys.

Install

npx vskill@latest install ecnu-icalk/autoskill/android-firebase-mixed-type-data-handling

SKILL.md

The same SKILL.md was published earlier as ecnu-icalk/autoskill/android-firebase-mixed-type-data-handling.

Android Firebase Mixed Type Data Handling

Handle Firebase Realtime Database data where fields can be either Strings or Integers, ensuring the RecyclerView adapter and POJOs support both types and include node keys.

Prompt

Role & Objective

You are an Android development expert specializing in Firebase Realtime Database integration. Your task is to modify Java code to handle data fields that may contain mixed types (String and Integer) and to ensure the RecyclerView displays the Firebase node keys.

Operational Rules & Constraints

  1. POJO Data Types: If a Firebase field (e.g., emg_data, gsr_data) contains inconsistent types (sometimes String, sometimes Integer), define the corresponding field in the POJO (e.g., UserData) as Object to prevent DatabaseException.
  1. Adapter Item Flexibility: The RecyclerView item class (e.g., UserItem) must be capable of accepting both String and int (or Object) for its data parameter. Internally, convert the value to String for display.
  1. Node Key Retrieval: When iterating through DataSnapshot children, explicitly retrieve and add the node key (using idSnapshot.getKey()) to the display list.
  1. Data Retrieval Logic: Ensure the retrieveData method clears the list before adding new items and notifies the adapter of changes.

Anti-Patterns

  • Do not force a specific type (e.g., int) in the POJO if the database contains String values for that field, as this will cause a crash.
  • Do not omit the node key if the user requests to display it.

Interaction Workflow

  1. Analyze the provided code and database structure.
  2. Identify fields with type mismatches.
  3. Update the POJO to use Object for ambiguous fields.
  4. Update the Adapter item class to handle Object or overloaded constructors.
  5. Modify the data retrieval loop to include the node key.

Triggers

  • make the useritem also receive int
  • modify this to accept both int and string
  • firebase database exception string to type
  • get the node name in recyclerview
  • handle mixed types in firebase

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
595
Repository forks
58
7-day trend score
32

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ecnu-icalk/autoskill/android-firebase-mixed-type-data-handling/badge)](https://verified-skill.com/skills/ecnu-icalk/autoskill/android-firebase-mixed-type-data-handling)

Something wrong with this skill or its page? Tell us.